apiaryio 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
data/.rspec CHANGED
@@ -1 +1,2 @@
1
1
  --colour
2
+ --format documentation
@@ -2,8 +2,7 @@ language: ruby
2
2
  sudo: false
3
3
  rvm:
4
4
  - "1.9.3"
5
- - "2.0.0"
6
- - "2.1.1"
5
+ - "2.3.0"
7
6
  - "jruby-19mode" # JRuby in 1.9 mode
8
7
  - "rbx-2"
9
8
 
@@ -0,0 +1,4 @@
1
+ FROM coopermaa/alpine-ruby:2.2
2
+ RUN apk add --update build-base && rm /var/cache/apk/*
3
+ RUN gem install apiaryio
4
+ ENTRYPOINT ["apiary"]
data/README.md CHANGED
@@ -25,6 +25,21 @@ For instructions on making your own changes, see [Hacking Apiary CLI Client](#h
25
25
  gem install apiaryio
26
26
  ```
27
27
 
28
+ ### Using Docker - alternative if you don't install ruby or installation not work for you
29
+
30
+ Download image:
31
+
32
+ ```
33
+ docker pull apiaryio/client
34
+ ```
35
+ Run instead `apiary` just `docker run apiaryio/client`
36
+
37
+ Build from source code:
38
+
39
+ ```
40
+ docker build -t "apiaryio/client" .
41
+ ```
42
+
28
43
  ### Setup Apiary credentials
29
44
 
30
45
  *Required only for publish and fetch commands.*
data/Rakefile CHANGED
@@ -17,8 +17,8 @@ end
17
17
 
18
18
  desc "Run all specs"
19
19
  RSpec::Core::RakeTask.new(:spec) do |t|
20
+ t.fail_on_error = false
20
21
  t.verbose = true
21
- t.rspec_opts = "-fd"
22
22
  end
23
23
 
24
24
  desc 'Default: Run all specs.'
@@ -23,7 +23,7 @@ Gem::Specification.new do |gem|
23
23
 
24
24
  gem.add_runtime_dependency "json", "~> 1.8"
25
25
 
26
- gem.add_development_dependency "rspec", "~> 3.2"
26
+ gem.add_development_dependency "rspec", "~> 3.2.0"
27
27
  gem.add_development_dependency "webmock", "~> 1.20"
28
28
  gem.add_development_dependency "yard", "~> 0.8"
29
29
  gem.add_development_dependency "aruba", ">= 0.6.2", "< 0.7.0"
@@ -24,7 +24,7 @@ module Apiary
24
24
  :content_type => "text/plain",
25
25
  :authentication => "Token #{@options.api_key}"
26
26
  }
27
- @options.commit_message ||= "Saving blueprint from apiary-client"
27
+ @options.message ||= "Saving blueprint from apiary-client"
28
28
  end
29
29
 
30
30
  def execute()
@@ -63,7 +63,7 @@ module Apiary
63
63
  if validate_apib_file path
64
64
  data = {
65
65
  :code => get_apib_file(path),
66
- :messageToSave => @options.commit_message
66
+ :messageToSave => @options.message
67
67
  }
68
68
  RestClient.proxy = @options.proxy
69
69
 
@@ -1,3 +1,3 @@
1
1
  module Apiary
2
- VERSION = "0.3.3"
2
+ VERSION = "0.3.4"
3
3
  end
@@ -0,0 +1,48 @@
1
+ require 'spec_helper'
2
+
3
+ describe Apiary::Command::Publish do
4
+ context 'when constructed without a message' do
5
+ let(:message) do
6
+ Apiary::Command::Publish.new({
7
+ :api_name => 'myapi',
8
+ :path => './features/fixtures/apiary.apib'
9
+ }).options.message
10
+ end
11
+
12
+ it 'uses the default message' do
13
+ expect(message).to eq('Saving blueprint from apiary-client')
14
+ end
15
+ end
16
+
17
+ context 'when constructed with a message' do
18
+ let(:message) do
19
+ Apiary::Command::Publish.new({
20
+ :api_name => 'myapi',
21
+ :message => 'Custom message',
22
+ :path => './features/fixtures/apiary.apib'
23
+ }).options.message
24
+ end
25
+
26
+ it 'stores the message in the opts' do
27
+ expect(message).to eq('Custom message')
28
+ end
29
+ end
30
+
31
+ describe '#execute' do
32
+ context 'when calling with a custom message' do
33
+ before(:all) do
34
+ WebMock.stub_request(:post, 'https://api.apiary.io/blueprint/publish/myapi')
35
+ Apiary::Command::Publish.new({
36
+ :api_name => 'myapi',
37
+ :message => 'Custom message',
38
+ :path => './features/fixtures/apiary.apib'
39
+ }).execute
40
+ end
41
+
42
+ it 'sends the message when publishing' do
43
+ expect(WebMock).to have_requested(:post, 'https://api.apiary.io/blueprint/publish/myapi').
44
+ with {|request| request.body.include? 'messageToSave=Custom%20message'}
45
+ end
46
+ end
47
+ end
48
+ end
@@ -7,4 +7,3 @@ RSpec.configure do |config|
7
7
  end
8
8
 
9
9
  Dir.glob(::File.expand_path('../support/*.rb', __FILE__)).each { |f| require_relative f }
10
-
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apiaryio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
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: 2015-11-26 00:00:00.000000000 Z
12
+ date: 2016-04-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
@@ -98,7 +98,7 @@ dependencies:
98
98
  requirements:
99
99
  - - ~>
100
100
  - !ruby/object:Gem::Version
101
- version: '3.2'
101
+ version: 3.2.0
102
102
  type: :development
103
103
  prerelease: false
104
104
  version_requirements: !ruby/object:Gem::Requirement
@@ -106,7 +106,7 @@ dependencies:
106
106
  requirements:
107
107
  - - ~>
108
108
  - !ruby/object:Gem::Version
109
- version: '3.2'
109
+ version: 3.2.0
110
110
  - !ruby/object:Gem::Dependency
111
111
  name: webmock
112
112
  requirement: !ruby/object:Gem::Requirement
@@ -194,6 +194,7 @@ files:
194
194
  - .gitignore
195
195
  - .rspec
196
196
  - .travis.yml
197
+ - Dockerfile
197
198
  - Gemfile
198
199
  - LICENSE
199
200
  - README.md
@@ -224,6 +225,7 @@ files:
224
225
  - spec/cli_spec.rb
225
226
  - spec/command/fetch_spec.rb
226
227
  - spec/command/preview_spec.rb
228
+ - spec/command/publish_spec.rb
227
229
  - spec/common_spec.rb
228
230
  - spec/spec_helper.rb
229
231
  - spec/support/aruba.rb
@@ -266,6 +268,7 @@ test_files:
266
268
  - spec/cli_spec.rb
267
269
  - spec/command/fetch_spec.rb
268
270
  - spec/command/preview_spec.rb
271
+ - spec/command/publish_spec.rb
269
272
  - spec/common_spec.rb
270
273
  - spec/spec_helper.rb
271
274
  - spec/support/aruba.rb