shipcloud 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZjQxNjJjMmI2ODIwMzQ5MjE3NGZmMzE0MDlhNGRlZmIyYWM0OTU2ZA==
5
- data.tar.gz: !binary |-
6
- ZTk2OTc3ZDM0MmZhYTFiM2U4MTY5NjZjMGVmYzJiZjgzMWNiYjJmYw==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- MWU3YzRmZDBmZWQyOTI5ZDJhMDYyMjU2ZTI2NDI0YjI0YTU0OGZjMDczZmIy
10
- OTJhZWEyNzMwNDhlYTJjNTgzOTc4NzFkNTlmYmViODU4OTgzZjMzZDkzZmZk
11
- N2EzMzdmMjI3ZWUwY2Y3M2Q0M2VjZDhhNGE1Y2NhMTFkZDYwNzc=
12
- data.tar.gz: !binary |-
13
- ZjljMjBjMWIzMjU2ZjgyMTAyZGYzZjg4OTA2ZWJmMGY5ZGVjNzE0OTcyNDBh
14
- OTRkYzA3NTZkNmJjNTIxODU4MmNlMzZjODVlMjYzNDFhYzAyOGI4ZTFjMmU0
15
- NThlYzdiMWIzOGY2YjY0NTRmZGFhZmM4ODEwMTg4ZjUzNTFjMGY=
2
+ SHA1:
3
+ metadata.gz: 266ce622e2711933494527c5f8399799c1e6e062
4
+ data.tar.gz: 0fcd0029452c89b96d40bd615fce634c848eff03
5
+ SHA512:
6
+ metadata.gz: d0981f70cd47a5fcf2e21b4980f22fb371ae9caacf9a23ce03fdad61d15e4534e0f5e9b8e1691dad6460e6ff4869c5971a5359a6065435e55e5199fe4b97d4a5
7
+ data.tar.gz: 6d4c9c07b4c63f935c2efe521f44e3c65e4c90299384bfd033d7a1222054c76ce91b11a7968d4a917eb89a12d758f0257736120bb70936b0c1ec400d15bc7889
data/.gitignore CHANGED
@@ -14,4 +14,5 @@ rdoc
14
14
  spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
- tmp
17
+ tmp
18
+ vendor/bundle
data/.travis.yml ADDED
@@ -0,0 +1,8 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 2.0.0
5
+ - 2.1.1
6
+ - 2.1.2
7
+ - jruby
8
+ - rbx-2
data/Gemfile CHANGED
@@ -2,8 +2,3 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in shipcloud.gemspec
4
4
  gemspec
5
-
6
- gem "rspec"
7
- gem "rake"
8
- gem "webmock"
9
- gem "pry"
data/README.md CHANGED
@@ -25,7 +25,7 @@ Before using the shipcloud API, you need to set the API access key:
25
25
  Shipcloud.api_key = 'your-api-key-goes-here'
26
26
  ```
27
27
 
28
- Since Version 0.3.0, you can also do this via a configuration block, e.g. in an initializer:
28
+ Since Version 0.4.0, you can also do this via a configuration block, e.g. in an initializer:
29
29
 
30
30
  ```
31
31
  Shipcloud.configure do |config|
@@ -63,4 +63,3 @@ shipment.tracking_url # -> http://track.shipcloud.io/uzdgu22z3ed12
63
63
  3. Commit your changes (`git commit -am 'Add some feature'`)
64
64
  4. Push to the branch (`git push origin my-new-feature`)
65
65
  5. Create new Pull Request
66
-
data/Rakefile CHANGED
@@ -3,4 +3,12 @@ require 'rspec/core/rake_task'
3
3
 
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
6
- task default: :spec
6
+ task :console do
7
+ require 'irb'
8
+ require 'irb/completion'
9
+ require 'shipcloud'
10
+ ARGV.clear
11
+ IRB.start
12
+ end
13
+
14
+ task default: :spec
data/lib/shipcloud.rb CHANGED
@@ -49,12 +49,13 @@ module Shipcloud
49
49
 
50
50
 
51
51
  class Configuration
52
- attr_accessor :api_key, :api_base, :use_ssl
52
+ attr_accessor :api_key, :api_base, :use_ssl, :debug
53
53
 
54
54
  def initialize
55
55
  @api_key = nil
56
56
  @api_base = 'api.shipcloud.io'
57
57
  @use_ssl = true
58
+ @debug = false
58
59
  end
59
60
  end
60
61
 
@@ -12,12 +12,11 @@ module Shipcloud
12
12
  @https = Net::HTTP.new(Shipcloud.configuration.api_base, Net::HTTP.https_default_port)
13
13
  @https.use_ssl = true
14
14
  @https.verify_mode = OpenSSL::SSL::VERIFY_PEER
15
- # @https.ca_file = File.join(ROOT_PATH, "data/shipcloud.crt")
16
15
  else
17
16
  @https = Net::HTTP.new(Shipcloud.configuration.api_base, Net::HTTP.http_default_port)
18
17
  @https.use_ssl = false
19
18
  end
20
- @https.set_debug_output $stdout
19
+ @https.set_debug_output $stdout if Shipcloud.configuration.debug
21
20
  end
22
21
 
23
22
  def request
@@ -1,3 +1,3 @@
1
1
  module Shipcloud
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
data/shipcloud.gemspec CHANGED
@@ -19,7 +19,9 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_dependency "json"
22
- spec.add_development_dependency "bundler", "~> 1.3"
23
- spec.add_development_dependency "rake"
24
- spec.add_development_dependency "rspec"
22
+ spec.add_development_dependency 'bundler', '~> 1.6.0'
23
+ spec.add_development_dependency 'rake', '~> 10.3.0'
24
+ spec.add_development_dependency 'rspec', '~> 2.99.0'
25
+ spec.add_development_dependency 'webmock', '~> 1.18.0'
26
+ spec.add_development_dependency 'pry', '~> 0.10.0'
25
27
  end
@@ -65,14 +65,25 @@ describe Shipcloud do
65
65
  end
66
66
 
67
67
  it 'defaults use_ssl to true' do
68
- expect(Shipcloud.configuration.use_ssl).to be_true
68
+ expect(Shipcloud.configuration.use_ssl).to be true
69
69
  end
70
70
 
71
71
  it 'overwrites the default ssl mode' do
72
72
  Shipcloud.configure do |config|
73
73
  config.use_ssl = false
74
74
  end
75
- expect(Shipcloud.configuration.use_ssl).to be_false
75
+ expect(Shipcloud.configuration.use_ssl).to be false
76
+ end
77
+
78
+ it 'defaults debug to false' do
79
+ expect(Shipcloud.configuration.debug).to be false
80
+ end
81
+
82
+ it 'overwrites the default debug mode' do
83
+ Shipcloud.configure do |config|
84
+ config.debug = true
85
+ end
86
+ expect(Shipcloud.configuration.debug).to be true
76
87
  end
77
88
  end
78
89
  end
metadata CHANGED
@@ -1,71 +1,99 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shipcloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - sthollmann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-12 00:00:00.000000000 Z
11
+ date: 2014-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.3'
33
+ version: 1.6.0
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.3'
40
+ version: 1.6.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: 10.3.0
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: 10.3.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ! '>='
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: 2.99.0
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ! '>='
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: 2.99.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: webmock
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 1.18.0
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 1.18.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: pry
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 0.10.0
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 0.10.0
69
97
  description: A wrapper for the shipcloud API
70
98
  email:
71
99
  - stefan@webionate.de
@@ -73,8 +101,9 @@ executables: []
73
101
  extensions: []
74
102
  extra_rdoc_files: []
75
103
  files:
76
- - .gitignore
77
- - .rspec
104
+ - ".gitignore"
105
+ - ".rspec"
106
+ - ".travis.yml"
78
107
  - Gemfile
79
108
  - LICENSE.txt
80
109
  - README.md
@@ -108,17 +137,17 @@ require_paths:
108
137
  - lib
109
138
  required_ruby_version: !ruby/object:Gem::Requirement
110
139
  requirements:
111
- - - ! '>='
140
+ - - ">="
112
141
  - !ruby/object:Gem::Version
113
142
  version: '0'
114
143
  required_rubygems_version: !ruby/object:Gem::Requirement
115
144
  requirements:
116
- - - ! '>='
145
+ - - ">="
117
146
  - !ruby/object:Gem::Version
118
147
  version: '0'
119
148
  requirements: []
120
149
  rubyforge_project:
121
- rubygems_version: 2.0.7
150
+ rubygems_version: 2.3.0
122
151
  signing_key:
123
152
  specification_version: 4
124
153
  summary: A wrapper for the shipcloud API
@@ -129,4 +158,3 @@ test_files:
129
158
  - spec/shipcloud/shipment_spec.rb
130
159
  - spec/shipcloud_spec.rb
131
160
  - spec/spec_helper.rb
132
- has_rdoc: