nike_v2 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
data/lib/ext/core_ext.rb CHANGED
@@ -6,18 +6,4 @@ class String
6
6
  tr("-", "_").
7
7
  downcase
8
8
  end
9
- def ss_camelize(first_letter_in_uppercase = false)
10
- lower_case_and_underscored_word = self.to_s
11
- if first_letter_in_uppercase
12
- lower_case_and_underscored_word.gsub(/\/(.?)/) { "::#{$1.upcase}" }.gsub(/(?:^|_)(.)/) { $1.upcase }
13
- else
14
- lower_case_and_underscored_word[0].downcase + lower_case_and_underscored_word.camelize[1..-1]
15
- end
16
- end
17
- end
18
-
19
- class Symbol
20
- def ss_camelize(first_letter_in_uppercase = false)
21
- self.to_s.ss_camelize.to_sym
22
- end
23
9
  end
@@ -57,7 +57,15 @@ module NikeV2
57
57
  end
58
58
 
59
59
  def extract_api_args(args)
60
- args.inject({}){|h,a| h[a.first.camelize] = a.last if API_ARGS.include?(a.first); h}
60
+ args.inject({}){|h,a| h[camelize_word(a.first)] = a.last if API_ARGS.include?(a.first); h}
61
+ end
62
+
63
+ def camelize_word(word, first_letter_in_uppercase = false)
64
+ if !!first_letter_in_uppercase
65
+ word.to_s.gsub(/\/(.?)/) { "::#{$1.upcase}" }.gsub(/(?:^|_)(.)/) { $1.upcase }
66
+ else
67
+ (word[0].to_s.downcase + camelize_word(word, true)[1..-1]).to_sym
68
+ end
61
69
  end
62
70
 
63
71
  def fetch_and_build_activities
@@ -1,3 +1,3 @@
1
1
  module NikeV2
2
- VERSION = '0.2.2'
2
+ VERSION = '0.2.3'
3
3
  end
data/lib/nike_v2.rb CHANGED
@@ -1,4 +1,6 @@
1
1
  require 'alchemist'
2
+ require 'forwardable'
3
+ require 'ext/core_ext'
2
4
 
3
5
  require 'nike_v2/base'
4
6
  require 'nike_v2/metric'
@@ -10,5 +12,3 @@ require 'nike_v2/activity'
10
12
  require 'nike_v2/activities'
11
13
  require 'nike_v2/summary'
12
14
  require 'nike_v2/gps_data'
13
-
14
- require 'ext/core_ext'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nike_v2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: