├── .gitignore ├── Gemfile ├── Gemfile.lock ├── LICENSE.txt ├── README.md ├── Rakefile ├── bin ├── console └── setup ├── lib ├── xivapi.rb └── xivapi │ ├── errors.rb │ ├── http.rb │ ├── page.rb │ ├── paginator.rb │ ├── request.rb │ └── version.rb └── xivapi.gemspec /.gitignore: -------------------------------------------------------------------------------- 1 | /.bundle/ 2 | /.yardoc 3 | /_yardoc/ 4 | /coverage/ 5 | /doc/ 6 | /pkg/ 7 | /spec/reports/ 8 | /tmp/ 9 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } 4 | 5 | # Specify your gem's dependencies in xivapi.gemspec 6 | gemspec 7 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | PATH 2 | remote: . 3 | specs: 4 | xivapi (0.3.3) 5 | rest-client (>= 2.0) 6 | 7 | GEM 8 | remote: https://rubygems.org/ 9 | specs: 10 | domain_name (0.5.20190701) 11 | unf (>= 0.0.5, < 1.0.0) 12 | http-accept (1.7.0) 13 | http-cookie (1.0.3) 14 | domain_name (~> 0.5) 15 | mime-types (3.3.1) 16 | mime-types-data (~> 3.2015) 17 | mime-types-data (3.2020.0512) 18 | netrc (0.11.0) 19 | rake (10.4.2) 20 | rest-client (2.1.0) 21 | http-accept (>= 1.7.0, < 2.0) 22 | http-cookie (>= 1.0.2, < 2.0) 23 | mime-types (>= 1.16, < 4.0) 24 | netrc (~> 0.8) 25 | unf (0.1.4) 26 | unf_ext 27 | unf_ext (0.0.7.7) 28 | yard (0.9.19) 29 | 30 | PLATFORMS 31 | ruby 32 | 33 | DEPENDENCIES 34 | bundler (~> 1.16) 35 | rake (~> 10.0) 36 | xivapi! 37 | yard (~> 0.9.19) 38 | 39 | BUNDLED WITH 40 | 1.17.1 41 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2018 Matt Antonelli 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # XIVAPI 2 | 3 | A Ruby library for [XIVAPI](https://www.xivapi.com/). 4 | 5 | ## Installation 6 | 7 | Add this line to your application's Gemfile: 8 | 9 | ```ruby 10 | gem 'xivapi', git: 'https://github.com/xivapi/xivapi-ruby.git', tag: 'v0.3.3' 11 | ``` 12 | 13 | And then run: 14 | 15 | ``` 16 | $ bundle install 17 | ``` 18 | 19 | ## Documentation 20 | 21 | Full documentation for this library can be found [here](https://xivapi.github.io/xivapi-ruby/). For basic usage information, please see below. 22 | 23 | ## Usage 24 | 25 | Start by initializing a client. You can obtain an API key by signing in to XIVAPI [here](https://www.xivapi.com/app). The key is available under the Dev Account page after signing in. 26 | 27 | ```rb 28 | require 'xivapi' 29 | 30 | # Basic configuration 31 | client = XIVAPI::Client.new(api_key: 'abc123') 32 | 33 | # Advanced configuration 34 | client = XIVAPI::Client.new(api_key: 'abc123', language: 'fr') 35 | ``` 36 | 37 | Now that you have a client, you can use it to contact the API. Examples have been provided below for the various endpoints. For the full list of endpoints and their parameters, please reference the [request documentation](https://xivapi.github.io/xivapi-ruby/XIVAPI/Request.html). 38 | 39 | ### Response data 40 | The data returned from the API is automatically converted into [OpenStruct](https://ruby-doc.org/stdlib-2.0.0/libdoc/ostruct/rdoc/OpenStruct.html) objects with snake_cased keys. If the request returns multiple results (e.g. character search), it will be provided to you in the form of an `XIVAPI::Paginator` object. The paginator is [Enumerable](https://ruby-doc.org/core-2.4.1/Enumerable.html), allowing you to access the data with methods like `first`, `each`, `map` and `to_a`. 41 | 42 | See the examples below to get a better idea of how to access the data. 43 | 44 | ### Examples 45 | #### Search 46 | ```rb 47 | >> achievements = client.search(indexes: 'achievement', string: 'tankless') 48 | => ... 49 | >> achievements.map(&:name) 50 | => ["A Tankless Job II (Dark Knight)", "A Tankless Job I (Paladin)", "A Tankless Job I (Warrior)", "A Tankless Job II (Warrior)", "A Tankless Job I (Dark Knight)", "A Tankless Job II (Paladin)"] 51 | >> achievements.first.points 52 | => 10 53 | ``` 54 | 55 | #### Content 56 | ```rb 57 | >> client.content 58 | => ["Achievement", "AchievementCategory", "AchievementKind", ...] 59 | 60 | >> achievement = client.content(name: 'Achievement', limit: 1).first 61 | => ... 62 | >> achievement.name 63 | => "To Crush Your Enemies I" 64 | 65 | >> achievements = client.content(name: 'Achievement', ids: 4..5) 66 | => ... 67 | >> achievements.map(&:name) 68 | => ["To Crush Your Enemies IV", "To Crush Your Enemies V"] 69 | ``` 70 | 71 | #### Servers 72 | ```rb 73 | >> client.servers 74 | => ["Adamantoise", "Aegis", "Alexander", ...] 75 | ``` 76 | 77 | #### Character 78 | ```rb 79 | >> characters = client.character_search(name: 'raelys skyborn', server: 'behemoth') 80 | => ... 81 | >> id = characters.first.id 82 | => 7660136 83 | >> character = client.character(id: id, all_data: true) 84 | => ... 85 | >> character.character.name 86 | => "Raelys Skyborn" 87 | >> character.achievements.list.last.id 88 | => 692 89 | ``` 90 | 91 | #### Free Company 92 | ```rb 93 | >> fcs = client.free_company_search(name: 'lodestone', server: 'behemoth') 94 | => ... 95 | >> id = fcs.first.id 96 | => "9234349560946590421" 97 | >> fc = client.free_company(id: id, members: true) 98 | => ... 99 | >> fc.free_company.name 100 | => "Lodestone" 101 | >> fc.free_company_members.first.name 102 | => "Raelys Skyborn" 103 | ``` 104 | 105 | #### Linkshell 106 | ```rb 107 | >> linkshells = client.linkshell_search(name: 'thunderbirds', server: 'behemoth') 108 | => ... 109 | >> id = linkshells.first.id 110 | => "21955048183495181" 111 | >> linkshell = client.linkshell(id: id).linkshell 112 | => ... 113 | >> linkshell.name 114 | => "Thunderbirds" 115 | ``` 116 | 117 | #### PVP Team 118 | ```rb 119 | >> teams = client.pvp_team_search(name: 'kill', server: 'chaos') 120 | => ... 121 | >> team = client.pvp_team(id: teams.first.id).pvp_team 122 | => ... 123 | >> team.name 124 | => "!Kill_For_A_Friend!" 125 | ``` 126 | 127 | #### Patch List 128 | ```rb 129 | >> patch = client.patch_list.last 130 | => ... 131 | >> patch.name 132 | => "Patch 4.4: Prelude In Violet" 133 | >> Time.at(patch.release_date.to_i) 134 | => 2018-09-18 10:00:00 +0000 135 | ``` 136 | 137 | ## Development 138 | 139 | After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment. 140 | 141 | To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). 142 | 143 | ## Contributing 144 | 145 | Bug reports and pull requests are welcome on GitHub at https://github.com/xivapi/xivapi-ruby. 146 | 147 | ## License 148 | 149 | The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). 150 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require "bundler/gem_tasks" 2 | task :default => :spec 3 | -------------------------------------------------------------------------------- /bin/console: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require "bundler/setup" 4 | require "xivapi" 5 | 6 | require "irb" 7 | @client = XIVAPI::Client.new 8 | IRB.start(__FILE__) 9 | -------------------------------------------------------------------------------- /bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | set -vx 5 | 6 | bundle install 7 | -------------------------------------------------------------------------------- /lib/xivapi.rb: -------------------------------------------------------------------------------- 1 | require 'xivapi/version' 2 | 3 | require 'xivapi/errors' 4 | require 'xivapi/http' 5 | require 'xivapi/page' 6 | require 'xivapi/paginator' 7 | require 'xivapi/request' 8 | 9 | require 'rest-client' 10 | require 'json' 11 | require 'ostruct' 12 | 13 | # Base module for the XIVAPI library 14 | module XIVAPI 15 | include XIVAPI::Errors 16 | 17 | # The allowed language options 18 | LANGUAGE_OPTIONS = %w(en ja de fr cn kr).freeze 19 | 20 | # Client for making requests to XIVAPI 21 | class Client 22 | include XIVAPI::Request 23 | 24 | # @return [String] The API key 25 | attr_accessor :api_key 26 | 27 | # @return [true, false] Whether or not to query the staging API instead of production 28 | attr_accessor :staging 29 | 30 | # Initializes a new client for querying XIVAPI 31 | # @param api_key [String] API key provided by XIVAPI 32 | # @param language [String] Requested response langauge 33 | # @param staging [true, false] Whether or not to query the staging API instead of production 34 | def initialize(api_key: nil, language: :en, staging: false) 35 | @api_key = api_key 36 | 37 | self.language = language 38 | self.staging = staging 39 | end 40 | 41 | # @return [String] The language 42 | def language 43 | @language 44 | end 45 | 46 | # @param language [String, Symbol] The language to set for the client 47 | # @return The language 48 | def language=(language) 49 | lang = language.to_s.downcase 50 | raise ArgumentError, 'Unsupported language' unless LANGUAGE_OPTIONS.include?(lang) 51 | @language = lang 52 | end 53 | 54 | # @return [Hash] The default parameters for the client 55 | def default_params 56 | { private_key: @api_key, language: @language } 57 | end 58 | end 59 | end 60 | -------------------------------------------------------------------------------- /lib/xivapi/errors.rb: -------------------------------------------------------------------------------- 1 | module XIVAPI 2 | # Custom errors 3 | module Errors 4 | # Standard request error 5 | class RequestError < StandardError 6 | def initialize(response) 7 | if response.headers[:content_type] =~ /json/ 8 | message = JSON.parse(response)['Message'] 9 | else 10 | message = 'Error contacting the API.' 11 | end 12 | 13 | super(message) 14 | end 15 | end 16 | 17 | # Rate limited 18 | class RateLimitError < StandardError 19 | def initialize 20 | super('Too many requests.') 21 | end 22 | end 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /lib/xivapi/http.rb: -------------------------------------------------------------------------------- 1 | module XIVAPI 2 | # Makes HTTP request to XIVAPI 3 | module HTTP 4 | # Base URL for XIVAPI 5 | API_BASE = 'https://xivapi.com'.freeze 6 | 7 | # Base URL for the staging environment of XIVAPI 8 | STAGING_API_BASE = 'https://staging.xivapi.com'.freeze 9 | 10 | # Makes a request to XIVAPI 11 | # @param client [XIVAPI::Client] The client making the request 12 | # @param endpoint [String, Symbol] The endpoint to request 13 | # @param params [Hash] Request parameters 14 | # @param payload [Hash] Request body 15 | # @return the results of the request 16 | def request(client, endpoint, params = {}, payload = nil) 17 | url = request_url(client, endpoint) 18 | query_params = params.merge(client.default_params) 19 | .reject { |_, v| v.nil? || v.size == 0 } 20 | 21 | begin 22 | if payload 23 | response = RestClient::Request.execute(method: :get, url: url, headers: { params: query_params }, 24 | payload: payload.to_json) 25 | else 26 | response = RestClient.get(url, params: query_params) 27 | end 28 | 29 | body = JSON.parse(response.body) 30 | objectify(body) 31 | rescue RestClient::ExceptionWithResponse => e 32 | if e.http_code == 429 33 | raise XIVAPI::RateLimitError.new 34 | else 35 | raise XIVAPI::RequestError.new(e.response) 36 | end 37 | rescue RestClient::Exception => e 38 | raise e 39 | end 40 | end 41 | 42 | private 43 | def request_url(client, endpoint) 44 | "#{client.staging ? STAGING_API_BASE : API_BASE}/#{endpoint}" 45 | end 46 | 47 | def objectify(response) 48 | case response 49 | when Hash 50 | result = {} 51 | 52 | response.each do |key, value| 53 | case value 54 | when Hash, Array 55 | new_value = objectify(value) 56 | else 57 | new_value = value 58 | end 59 | 60 | result[underscore(key)] = new_value 61 | end 62 | 63 | OpenStruct.new(result) 64 | when Array 65 | response.map { |data| objectify(data) } 66 | else 67 | response 68 | end 69 | end 70 | 71 | def underscore(key) 72 | key.gsub('PvPTeam', 'PvpTeam').gsub(/([a-z\d])([A-Z])/,'\1_\2').gsub('.', '_').downcase 73 | end 74 | end 75 | end 76 | -------------------------------------------------------------------------------- /lib/xivapi/page.rb: -------------------------------------------------------------------------------- 1 | module XIVAPI 2 | # A single page of results from XIVAPI 3 | class Page 4 | # @return the results 5 | attr_reader :results 6 | 7 | # @return [Integer] the page number of the next results 8 | attr_reader :next_page 9 | 10 | # Creates an object for storing a Page of results from XIVAPI 11 | # @param response The response of an HTTP request 12 | def initialize(response) 13 | @results = response.results 14 | pagination = response.pagination 15 | @next_page = pagination.page_next unless pagination.page == pagination.page_total 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /lib/xivapi/paginator.rb: -------------------------------------------------------------------------------- 1 | module XIVAPI 2 | # Paginates XIVAPI results 3 | class Paginator 4 | include Enumerable 5 | include XIVAPI::HTTP 6 | 7 | # @param client [XIVAPI::Client] Client that is sending the request 8 | # @param params [Hash] Query parameters 9 | # @param endpoint [String] API endpoint 10 | # @param limit [Integer] Total number of results to limit to 11 | # @param body [Hash] Request body (for advanced search) 12 | # @param per_page [Integer] Number of results per page, defaults to limit 13 | def initialize(client, params, endpoint, limit, body = nil, per_page = limit) 14 | @client = client 15 | @params = params.merge(limit: per_page) 16 | @endpoint = endpoint 17 | @limit = limit 18 | @body = body 19 | end 20 | 21 | # An enumerator for XIVAPI results 22 | def each 23 | total = 0 24 | next_page = 1 25 | 26 | while next_page && total < @limit 27 | page = self.next(next_page) 28 | page.results.take(@limit - total).each { |result| yield result } 29 | next_page = page.next_page 30 | total += page.results.size 31 | end 32 | end 33 | 34 | # The next page in the enumeration of results 35 | def next(page) 36 | response = request(@client, @endpoint, @params.merge(page: page), @body) 37 | Page.new(response) 38 | end 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /lib/xivapi/request.rb: -------------------------------------------------------------------------------- 1 | # Collection of requests that can be made to XIVAPI 2 | module XIVAPI::Request 3 | include XIVAPI::HTTP 4 | 5 | # The results limit applied to Lodestone requests 6 | LODESTONE_LIMIT = 50.freeze 7 | 8 | # Options used to retrieve all data when querying a character 9 | ALL_CHARACTER_DATA = 'AC,MIMO,CJ,FR,FC,FCM,PVP'.freeze 10 | 11 | # @param indexes [String, Array ] One or more indexes to search on 12 | # @param string [String] Value to search for in the string column 13 | # @param string_column [String] Column to perform the string search on 14 | # @param string_algo [String] Algorithm to use for the search 15 | # @param sort_field [String] Column to sort results by 16 | # @param sort_order [String] Order to sort results by 17 | # @param limit [Integer] Total number of results to limit to 18 | # @param body [Hash] Request body for advanced ElasticSearch queries 19 | # @param filters [String, Array ] One or more filters to search on 20 | # @param columns [String, Array ] One or more columns to limit results to 21 | # @return [XIVAPI::Paginator] Enumerable search results 22 | def search(indexes: [], string: '', string_column: nil, string_algo: nil, 23 | sort_field: nil, sort_order: nil, limit: 100, body: nil, filters: [], columns: []) 24 | params = { indexes: [*indexes].join(','), string: string, string_column: string_column, string_algo: string_algo, 25 | sort_field: sort_field, sort_order: sort_order, filters: [*filters].join(','), columns: [*columns].join(',') } 26 | XIVAPI::Paginator.new(self, params, 'search', limit, body) 27 | end 28 | 29 | # @param string [String] String of lore to search for 30 | # @param limit [Integer] Total number of results to limit to 31 | # @return [XIVAPI::Paginator] Enumerable lore results 32 | def lore(string: '', limit: 100) 33 | XIVAPI::Paginator.new(self, { string: string }, 'lore', limit) 34 | end 35 | 36 | # @param name [String] Name of the content (e.g. Achievement, Action, Item) 37 | # @param ids [Integer, Array] One or more IDs to retrieve 38 | # @param minify [true, false] Minify resulting data where depth > 1 39 | # @param limit [Integer] Total number of results to limit to 40 | # @param columns [String, Array ] One or more columns to limit results to 41 | # @return [Array, OpenStruct, XIVAPI::Paginator] 42 | # Calling with no parameters will return the list of content names 43 | # Calling with a name and a single ID will return that specific content 44 | # Calling with a name and not a singe ID will return enumerable results 45 | def content(name: nil, ids: [], minify: false, limit: 100, columns: []) 46 | if name.nil? 47 | request(self, 'content') 48 | elsif [*ids].size == 1 49 | params = { minify: minify ? 1 : 0, columns: [*columns].join(',') } 50 | request(self, "#{name}/#{[*ids].first}", params) 51 | else 52 | params = { ids: [*ids].join(','), columns: [*columns].join(',') } 53 | XIVAPI::Paginator.new(self, params, name, limit) 54 | end 55 | end 56 | 57 | # @param group [true, false] Group the servers by data center 58 | # @return [Array] List of servers 59 | def servers(group: false) 60 | endpoint = group ? 'servers/dc' : 'servers' 61 | request(self, endpoint) 62 | end 63 | 64 | # @param id [Integer] Character ID 65 | # @param all_data [true, false] Return the full set of character data 66 | # @param extended [true, false] Return additional data for various fields (e.g. name, icon) 67 | # @param data [String, Array ] Additional data to request, see: https://xivapi.com/docs/Character#character 68 | # @param columns [String, Array ] One or more columns to limit results to 69 | # @return [OpenStruct] The requested character 70 | def character(id: nil, all_data: false, extended: false, data: [], columns: []) 71 | params = { data: character_data(all_data, data), columns: [*columns].join(',') } 72 | params[:extended] = 1 if extended 73 | request(self, "character/#{id}", params) 74 | end 75 | 76 | # @param name [String] Character name 77 | # @param server [String] Character server 78 | # @param columns [String, Array ] One or more columns to limit results to 79 | # @return [XIVAPI::Paginator] Enumerable search results 80 | def character_search(name: nil, server: nil, columns: []) 81 | params = { name: name, server: server, columns: [*columns].join(',') } 82 | XIVAPI::Paginator.new(self, params, 'character/search', LODESTONE_LIMIT) 83 | end 84 | 85 | # @param id [Integer] Character ID 86 | # @param token [String] Verification token to check for 87 | # @return [true, false] Whether or not the character is verified 88 | def character_verified?(id: nil, token: nil) 89 | character(id: id, columns: 'Character.Bio').character.bio.match?(token) 90 | end 91 | 92 | # @param id [Integer] Free company ID 93 | # @param members [true, false] Return member data 94 | # @param columns [String, Array ] One or more columns to limit results to 95 | # @return [OpenStruct] The requested free company 96 | def free_company(id: nil, members: false, columns: []) 97 | params = { data: members ? 'FCM' : nil, columns: [*columns].join(',') } 98 | request(self, "freecompany/#{id}", params) 99 | end 100 | 101 | # @param name [String] Free company name 102 | # @param server [String] Free company server 103 | # @param columns [String, Array ] One or more columns to limit results to 104 | # @return [XIVAPI::Paginator] Enumerable search results 105 | def free_company_search(name: nil, server: nil, columns: []) 106 | params = { name: name, server: server, columns: [*columns].join(',') } 107 | XIVAPI::Paginator.new(self, params, 'freecompany/search', LODESTONE_LIMIT) 108 | end 109 | 110 | # @param id [Integer] Linkshell ID 111 | # @param columns [String, Array ] One or more columns to limit results to 112 | # @return [OpenStruct] The requested linkshell 113 | def linkshell(id: nil, columns: []) 114 | params = { columns: [*columns].join(',') } 115 | request(self, "linkshell/#{id}", params) 116 | end 117 | 118 | # @param name [String] Linkshell name 119 | # @param server [String] Linkshell server 120 | # @param columns [String, Array ] One or more columns to limit results to 121 | # @return [XIVAPI::Paginator] Enumerable search results 122 | def linkshell_search(name: nil, server: nil, columns: []) 123 | params = { name: name, server: server, columns: [*columns].join(',') } 124 | XIVAPI::Paginator.new(self, params, 'linkshell/search', LODESTONE_LIMIT) 125 | end 126 | 127 | # @param id [Integer] PVP team ID 128 | # @param columns [String, Array ] One or more columns to limit results to 129 | # @return [OpenStruct] The requested PVP team 130 | def pvp_team(id: nil, columns: []) 131 | params = { columns: [*columns].join(',') } 132 | request(self, "pvpteam/#{id}", params) 133 | end 134 | 135 | # @param name [String] PVP team name 136 | # @param server [String] PVP team server 137 | # @param columns [String, Array ] One or more columns to limit results to 138 | # @return [XIVAPI::Paginator] Enumerable search results 139 | def pvp_team_search(name: nil, server: nil, columns: []) 140 | params = { name: name, server: server, columns: [*columns].join(',') } 141 | XIVAPI::Paginator.new(self, params, 'pvpteam/search', LODESTONE_LIMIT) 142 | end 143 | 144 | # @return [Array] List of game patches 145 | def patch_list 146 | request(self, 'patchlist') 147 | end 148 | 149 | private 150 | def character_data(all_data, data) 151 | all_data ? ALL_CHARACTER_DATA : [*data].join(',') 152 | end 153 | end 154 | -------------------------------------------------------------------------------- /lib/xivapi/version.rb: -------------------------------------------------------------------------------- 1 | module XIVAPI 2 | # Gem version 3 | VERSION = "0.3.3" 4 | end 5 | -------------------------------------------------------------------------------- /xivapi.gemspec: -------------------------------------------------------------------------------- 1 | 2 | lib = File.expand_path("../lib", __FILE__) 3 | $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) 4 | require "xivapi/version" 5 | 6 | Gem::Specification.new do |spec| 7 | spec.name = "xivapi" 8 | spec.version = XIVAPI::VERSION 9 | spec.authors = ["Matt Antonelli"] 10 | spec.email = ["contact@raelys.com"] 11 | 12 | spec.summary = %q{A Ruby library for XIVAPI} 13 | spec.description = %q{A Ruby library for XIVAPI (http://www.xivapi.com)} 14 | spec.homepage = "https://github.com/xivapi/xivapi-ruby" 15 | spec.license = "MIT" 16 | 17 | spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do 18 | `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } 19 | end 20 | 21 | spec.add_development_dependency "bundler", "~> 1.16" 22 | spec.add_development_dependency "rake", "~> 10.0" 23 | spec.add_development_dependency "yard", "~> 0.9.19" 24 | spec.add_dependency "rest-client", ">= 2.0" 25 | end 26 | --------------------------------------------------------------------------------