heroics 0.0.20 → 0.0.21

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7fcc9cadffe081a87791e1eaf0e2c15fe8f4ab2e
4
- data.tar.gz: 730f086a9acc0878301b3357990b144555a1e1a2
3
+ metadata.gz: 3b42c680d9fc2051a178839597105346700c037f
4
+ data.tar.gz: 994a3d4567585660665351aecfe66709cc360f00
5
5
  SHA512:
6
- metadata.gz: 69da806503628e6636782d95693c40548d3958aba3dff089e12dcd6264707d3d588c83c2d98f960fcdc6d57eb47d194686aab2114b84eb2c7209dd8dfc62b5c0
7
- data.tar.gz: 4d2fbd0ad96211843edc9836afdcdb77e64c309f19017ed757473475159fd453f4cca3afe113bea629dd152fcff7abd5af4a49d17c997e9a8601a95476b35289
6
+ metadata.gz: 39f3ec1ec24f29d83d0d5c5a88fa9ae10a596fdd9e03cc127dc07260fb399333b436413b9f24cfb569ca1055d443cecc768e7d62713a0b79f4510abb612024aa
7
+ data.tar.gz: c34cbe354b65f8d428e00e26231b0f55b63034580ce8a9afd55357d4b1bb4f44abdba44f2b55af4e7f2d2d21e0cb96772c66fed215db61148f2a2064acc236f3
@@ -27,6 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.add_development_dependency 'rake'
28
28
  spec.add_development_dependency 'turn'
29
29
  spec.add_development_dependency 'yard'
30
+ spec.add_development_dependency 'pry'
30
31
 
31
32
  spec.add_dependency 'erubis', '~> 2.0'
32
33
  spec.add_dependency 'excon'
@@ -8,7 +8,8 @@ module Heroics
8
8
  # to resources.
9
9
  # @param url [String] The URL used by this client.
10
10
  def initialize(resources, url)
11
- @resources = resources
11
+ # Transform resource keys via the ruby_name replacement semantics
12
+ @resources = Hash[resources.map{ |k, v| [Heroics.ruby_name(k), v] }]
12
13
  @url = url
13
14
  end
14
15
 
@@ -21,8 +22,9 @@ module Heroics
21
22
  name = name.to_s
22
23
  resource = @resources[name]
23
24
  if resource.nil?
24
- # Try substituting underscores for dashes
25
- name = name.to_s.gsub('_', '-')
25
+ # Find the name using the same ruby_name replacement semantics as when
26
+ # we set up the @resources hash
27
+ name = Heroics.ruby_name(name)
26
28
  resource = @resources[name]
27
29
  if resource.nil?
28
30
  raise NoMethodError.new("undefined method `#{name}' for #{to_s}")
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Heroics
3
- VERSION = '0.0.20'
3
+ VERSION = '0.0.21'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heroics
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.20
4
+ version: 0.0.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - geemus
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-02-23 00:00:00.000000000 Z
12
+ date: 2017-03-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -109,6 +109,20 @@ dependencies:
109
109
  - - ">="
110
110
  - !ruby/object:Gem::Version
111
111
  version: '0'
112
+ - !ruby/object:Gem::Dependency
113
+ name: pry
114
+ requirement: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
119
+ type: :development
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - ">="
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
112
126
  - !ruby/object:Gem::Dependency
113
127
  name: erubis
114
128
  requirement: !ruby/object:Gem::Requirement