d3api 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
+ - 2.0.0
3
4
  - 1.9.3
4
5
  - 1.9.2
5
6
  - jruby-19mode
@@ -1,13 +1,14 @@
1
1
  module D3api
2
2
  class Artisan < BaseModel
3
- attr_accessor :slug, :name, :portrait, :training
4
-
5
3
  ARTISAN_MAPPING = {
6
4
  :slug => 'slug',
7
5
  :name => 'name',
8
6
  :portrait => 'portrait',
9
7
  :training => nil
10
8
  }
9
+
10
+ attr_accessor :slug, :name, :portrait, :training
11
+
11
12
  def initialize(region=:us, artisan_type)
12
13
  json_response = find(region, artisan_type)
13
14
 
@@ -6,6 +6,7 @@ module D3api
6
6
  :portrait => 'portrait',
7
7
  :active_skills => nil
8
8
  }
9
+
9
10
  attr_accessor :slug, :name, :portrait, :active_skills
10
11
 
11
12
  def initialize(region, follower_type)
@@ -5,12 +5,12 @@ module D3api
5
5
  :name => 'name',
6
6
  :hero_class => 'class',
7
7
  :level => 'level',
8
- :hardcore => 'hardcore'
8
+ :hardcore => 'hardcore',
9
+ :paragon_level => 'paragonLevel'
9
10
  }
10
11
 
11
- include D3api::Request
12
12
  attr_accessor :id, :name, :hero_class, :gender,
13
- :level, :hardcore, :last_updated,
13
+ :level, :hardcore, :paragon_level, :last_updated,
14
14
  :items, :active_skills, :passive_skills,
15
15
  :followers, :stats
16
16
 
@@ -31,13 +31,15 @@ module D3api
31
31
  :primary_resource => 'primaryResource',
32
32
  :secondary_resource => 'secondaryResource'
33
33
  }
34
+
34
35
  attr_accessor :life, :damage, :attack_speed, :armor, :strength,
35
36
  :dexterity, :vitality, :intelligence, :physical_resist,
36
- :fire_resist, :cold_resist, :lightning_resist, :poison_resist,
37
- :arcane_resist, :crit_damage, :block_chance, :block_amount_min,
38
- :block_amount_max, :damage_increase, :crit_chance, :damage_reduction,
39
- :thorns, :life_steal, :life_per_kill, :gold_find, :magic_find,
40
- :life_on_hit, :primary_resource, :secondary_resource
37
+ :fire_resist, :cold_resist, :lightning_resist,
38
+ :poison_resist, :arcane_resist, :crit_damage, :block_chance,
39
+ :block_amount_min, :block_amount_max, :damage_increase,
40
+ :crit_chance, :damage_reduction, :thorns, :life_steal,
41
+ :life_per_kill, :gold_find, :magic_find, :life_on_hit,
42
+ :primary_resource, :secondary_resource
41
43
 
42
44
  def initialize(stat_values)
43
45
  set_method(stat_values, STAT_MAPPINGS)
@@ -10,6 +10,7 @@ module D3api
10
10
  :bonus_affixes => 'bonusAffixes',
11
11
  :attributes => 'attributes'
12
12
  }
13
+
13
14
  attr_accessor :name, :icon, :tooltip_params, :display_color,
14
15
  :required_level, :item_level, :bonus_affixes,
15
16
  :attributes, :min_dps, :max_dps, :min_attacks_per_second,
@@ -1,3 +1,3 @@
1
1
  module D3api
2
- VERSION = '1.1.1'
2
+ VERSION = '1.1.2'
3
3
  end
@@ -18,10 +18,11 @@ describe D3api::Hero do
18
18
  its(:hero_class) { should eql 'barbarian' }
19
19
  its(:gender) { should eql 'Male' }
20
20
  its(:level) { should eql 45 }
21
- its(:hardcore) { should be_kind_of(TrueClass) }
21
+ its(:hardcore) { should eql true }
22
22
  its(:last_updated) { should be_kind_of(Time) }
23
23
  its(:active_skills) { should be_kind_of(Array) }
24
24
  its(:passive_skills) { should be_kind_of(Array) }
25
+ its(:paragon_level) { should eql 0 }
25
26
  its(:items) { should be_kind_of(Array) }
26
27
  its(:followers) { should be_kind_of(Array) }
27
28
  end
@@ -12,7 +12,7 @@ describe D3api::Item do
12
12
  it { should_not be nil}
13
13
  end
14
14
 
15
- context 'set_method' do
15
+ context 'set_method', 'non-weapon' do
16
16
  its(:name) { should eql 'Cloth Pants' }
17
17
  its(:icon) { should eql 'pants_001_monk_male' }
18
18
  its(:display_color) { should be_kind_of(String) }
@@ -28,4 +28,13 @@ describe D3api::Item do
28
28
  its(:socket_effects) { should be nil }
29
29
  its(:salvage) { should be nil }
30
30
  end
31
+
32
+ context 'set_method', 'weapon' do
33
+ subject { D3api::Item.new(:us, 'COGHsoAIEgcIBBXIGEoRHYQRdRUdnWyzFB2qXu51MA04kwNAAFAKYJMD') }
34
+
35
+ its(:min_dps) { should eql 206.69999241828918 }
36
+ its(:max_dps) { should eql 206.69999241828918 }
37
+ its(:min_attacks_per_second) { should eql 1.2999999523162842 }
38
+ its(:max_attacks_per_second) { should eql 1.2999999523162842 }
39
+ end
31
40
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: d3api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-14 00:00:00.000000000 Z
12
+ date: 2013-04-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
@@ -189,18 +189,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
189
189
  - - ! '>='
190
190
  - !ruby/object:Gem::Version
191
191
  version: '0'
192
- segments:
193
- - 0
194
- hash: 1878087509152130220
195
192
  required_rubygems_version: !ruby/object:Gem::Requirement
196
193
  none: false
197
194
  requirements:
198
195
  - - ! '>='
199
196
  - !ruby/object:Gem::Version
200
197
  version: '0'
201
- segments:
202
- - 0
203
- hash: 1878087509152130220
204
198
  requirements: []
205
199
  rubyforge_project:
206
200
  rubygems_version: 1.8.24