ruby-iactionable 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG #
2
2
 
3
+ ## 0.0.3 ##
4
+
5
+ * Gem name matches require string.
6
+
3
7
  ## 0.0.2 ##
4
8
 
5
9
  * Gem name matches require string.
data/README.md CHANGED
@@ -10,7 +10,7 @@ Ruby IActionable is a straightforward wrapper for IActionable's restful API. Th
10
10
 
11
11
  ## IRB ##
12
12
 
13
- require 'iactionable'
13
+ require 'ruby-iactionable'
14
14
 
15
15
  ## Bundler ##
16
16
 
@@ -25,7 +25,7 @@ Before the API wrapper can be instantiated or used it must be pre-initialized wi
25
25
  :version => 3 )
26
26
  @api = IActionable::Api.new
27
27
 
28
- The responses for each of the endpoints of IActionable's API are described through example by [their documentation](http://www.iactionable.com/api/). Here is an example of the response from a [profile summary](http://iactionable.com/api/profiles/#getprofilesummary) returned as an object by the wrapper.
28
+ The responses for each of the endpoints of IActionable's API are described through example by [their documentation](http://www.iactionable.com/api/). Here is an example of the response from a [profile summary](http://iactionable.com/api/) returned as an object by the wrapper.
29
29
 
30
30
  profile_summary = @api.get_profile_summary("user", "username", "zortnac", 10)
31
31
  profile_summary.display_name # => "Chris Eberz"
@@ -14,7 +14,11 @@ module IActionable
14
14
  def self.timestamp_to_seconds(timestamp)
15
15
  milliseconds = timestamp[timestamp_regexp, 1]
16
16
  tz = timestamp[timestamp_regexp, 2]
17
- "#{Integer(milliseconds)/1000}#{tz}"
17
+ unless milliseconds.nil? || tz.nil?
18
+ "#{Integer(milliseconds)/1000}#{tz}"
19
+ else
20
+ nil
21
+ end
18
22
  end
19
23
 
20
24
  private
@@ -1,3 +1,3 @@
1
1
  module IActionable
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -49,6 +49,20 @@ describe "API response to get_profile_achievements" do
49
49
  lambda { IActionable::Objects::ProfileAchievements.new(@sample_response) }.should_not raise_error
50
50
  end
51
51
 
52
+ describe "with a malformed AwardDate string" do
53
+ before do
54
+ @sample_response["Completed"].first["AwardDate"] = 'bogus'
55
+ end
56
+
57
+ it "should not raise error on wrapping in an object" do
58
+ lambda { IActionable::Objects::ProfileAchievements.new(@sample_response) }.should_not raise_error
59
+ end
60
+
61
+ it "should set the value of AwardDate to nil" do
62
+ IActionable::Objects::ProfileAchievements.new(@sample_response).completed.first.award_date.should be_nil
63
+ end
64
+ end
65
+
52
66
  describe "when wrapped in an object" do
53
67
  before do
54
68
  @wrapped = IActionable::Objects::ProfileAchievements.new(Marshal.load(Marshal.dump(@sample_response)))
@@ -41,6 +41,20 @@ describe "API response to get_profile_challenges" do
41
41
  lambda { IActionable::Objects::ProfileChallenges.new(@sample_response) }.should_not raise_error
42
42
  end
43
43
 
44
+ describe "with a malformed AwardDate string" do
45
+ before do
46
+ @sample_response["Completed"].first["AwardDate"] = 'bogus'
47
+ end
48
+
49
+ it "should not raise error on wrapping in an object" do
50
+ lambda { IActionable::Objects::ProfileChallenges.new(@sample_response) }.should_not raise_error
51
+ end
52
+
53
+ it "should set the value of AwardDate to nil" do
54
+ IActionable::Objects::ProfileChallenges.new(@sample_response).completed.first.award_date.should be_nil
55
+ end
56
+ end
57
+
44
58
  describe "when wrapped in an object" do
45
59
  before do
46
60
  @wrapped = IActionable::Objects::ProfileChallenges.new(Marshal.load(Marshal.dump(@sample_response)))
@@ -43,6 +43,20 @@ describe "API response to get_profile_goals" do
43
43
  lambda { IActionable::Objects::ProfileGoals.new(@sample_response) }.should_not raise_error
44
44
  end
45
45
 
46
+ describe "with a malformed AwardDate string" do
47
+ before do
48
+ @sample_response["Completed"].first["AwardDate"] = 'bogus'
49
+ end
50
+
51
+ it "should not raise error on wrapping in an object" do
52
+ lambda { IActionable::Objects::ProfileGoals.new(@sample_response) }.should_not raise_error
53
+ end
54
+
55
+ it "should set the value of AwardDate to nil" do
56
+ IActionable::Objects::ProfileGoals.new(@sample_response).completed.first.award_date.should be_nil
57
+ end
58
+ end
59
+
46
60
  describe "when wrapped in an object" do
47
61
  before do
48
62
  @wrapped = IActionable::Objects::ProfileGoals.new(Marshal.load(Marshal.dump(@sample_response)))
data/spec/spec_helper.rb CHANGED
@@ -1 +1 @@
1
- require 'ruby_iactionable'
1
+ require 'ruby-iactionable'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-iactionable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-03 00:00:00.000000000Z
12
+ date: 2012-03-01 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &2156111480 !ruby/object:Gem::Requirement
16
+ requirement: &2164995580 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '2.6'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *2156111480
24
+ version_requirements: *2164995580
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rake
27
- requirement: &2156111060 !ruby/object:Gem::Requirement
27
+ requirement: &2164995160 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2156111060
35
+ version_requirements: *2164995160
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: faraday
38
- requirement: &2156110600 !ruby/object:Gem::Requirement
38
+ requirement: &2164994700 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2156110600
46
+ version_requirements: *2164994700
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: faraday-stack
49
- requirement: &2156110180 !ruby/object:Gem::Requirement
49
+ requirement: &2164994280 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *2156110180
57
+ version_requirements: *2164994280
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: activesupport
60
- requirement: &2156109680 !ruby/object:Gem::Requirement
60
+ requirement: &2164993780 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: 3.0.0
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *2156109680
68
+ version_requirements: *2164993780
69
69
  description: Ruby wrapper for IActionable's restful API.
70
70
  email:
71
71
  - ceberz@elctech.com