badgerkit 0.0.5 → 0.0.6

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: f45d46a2e878d20b9cc2450d0ea9a5c7e867f965
4
- data.tar.gz: 3900dfee75c60caca013ce8c7b728e39ff5f5701
3
+ metadata.gz: ef4d5b0fc6e60ac2ce01bcc9d382ad68594f7f8c
4
+ data.tar.gz: 3d179b99e463f475c8eaf5d8d30373e9de0d12a0
5
5
  SHA512:
6
- metadata.gz: 631f5475ca384a067249d57600aeb0b3e9a55770f75033508a10d522eec6e4d0a57a8a9570d8b1adb4f6a87f2634f44123ad5949f55a0201198129c360211245
7
- data.tar.gz: 40eeb46d82b70c869b07a67447c71d6727c83abd15417b5d292c021d5f4e8649dfe2c5729c4e69b79c217a7bf9698123cbc5aa644d37683e1ea732ac41a9d3f4
6
+ metadata.gz: 66ba1da53b8df8f79cfcc4d950fafa6ee3b4e5317c7572856e3aa80d1a6c48fcd42f2b564ab48c3806e5b24733a060d184e4982ee446e88cf06c9b9ca513507b
7
+ data.tar.gz: e101973ccd5bf6cb313c6f17a6dd4e5e3906187c4e332ce426457d2f97743de9508b69c3cd721991ac9c8d7050c8e445984c7cccbea7fb9087675dc2f058b457
data/.gitignore CHANGED
@@ -3,6 +3,7 @@
3
3
  .bundle
4
4
  .config
5
5
  .yardoc
6
+ .DS_Store
6
7
  Gemfile.lock
7
8
  InstalledFiles
8
9
  _yardoc
@@ -14,4 +15,4 @@ rdoc
14
15
  spec/reports
15
16
  test/tmp
16
17
  test/version_tmp
17
- tmp
18
+ tmp/
data/README.md CHANGED
@@ -40,7 +40,8 @@ client = Badgerkit.new(
40
40
  client.post('Documentation',
41
41
  :value => 80,
42
42
  :commit_sha1 => '0dbce1478e94053d4282ccd4ace154c82a3475d5',
43
- :branch => 'master'
43
+ :branch => 'master',
44
+ :archive => Badgerkit.archive('doc/')
44
45
  )
45
46
  ```
46
47
 
@@ -54,7 +55,8 @@ ENV['BADGER_REPO'] = 'saladdays/badgerkit.rb'
54
55
  Badgerkit.post('Documentation',
55
56
  :value => 80,
56
57
  :commit_sha1 => '0dbce1478e94053d4282ccd4ace154c82a3475d5',
57
- :branch => 'master'
58
+ :branch => 'master',
59
+ :archive => Badgerkit.archive('doc/')
58
60
  )
59
61
  ```
60
62
 
data/badgerkit.gemspec CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Johan van Zonneveld"]
10
10
  spec.email = ["johan@vzonneveld.nl"]
11
11
  spec.summary = "Toolkit for badgerhq.com"
12
- spec.description = "Write a description"
12
+ spec.description = "Simple api wrapper for submitting data to badgerhq.com"
13
13
  spec.homepage = "https://github.com/saladdays-nl/badgerkit.rb"
14
14
  spec.license = "MIT"
15
15
 
@@ -16,7 +16,7 @@ module Badgerkit
16
16
 
17
17
  File.delete(filename) rescue nil # Make sure there's not already an archive
18
18
 
19
- ## Zip the direvory
19
+ ## Zip the directory
20
20
  Zip::File.open(filename, Zip::File::CREATE) do |zipfile|
21
21
  Dir[File.join(directory, '**', '**')].each do |file|
22
22
  zipfile.add(file.sub(directory, ''), file)
@@ -1,4 +1,4 @@
1
1
  module Badgerkit
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end # Badgerkit
4
4
 
@@ -0,0 +1,30 @@
1
+ require 'spec_helper'
2
+
3
+ describe Badgerkit::Archive do
4
+
5
+ describe '.archive' do
6
+
7
+ it 'should archive the directory and return a file' do
8
+ file = Badgerkit::Archive.archive('spec/fixtures/archive_folder/')
9
+ file.should be_kind_of(File)
10
+ end
11
+
12
+ it 'should delete the previously generated archive on second run' do
13
+ Badgerkit::Archive.archive('spec/fixtures/archive_folder/')
14
+ File.delete('tmp/archive_folder.zip') # Make sure we don't stub delete.
15
+ File.should_receive(:delete).with('tmp/archive_folder.zip')
16
+ Badgerkit::Archive.archive('spec/fixtures/archive_folder/')
17
+ end
18
+
19
+ it 'should contain files' do
20
+ Badgerkit::Archive.archive('spec/fixtures/archive_folder/')
21
+
22
+ Zip::File.open('tmp/archive_folder.zip') do |zip_file|
23
+ entry = zip_file.glob('*.yml').first
24
+ entry.should be_kind_of(Zip::Entry)
25
+ end
26
+ end
27
+
28
+ end
29
+
30
+ end
@@ -39,7 +39,7 @@ describe Badgerkit::Client do
39
39
  :repo => 'saladdays/badgerkit.rb',
40
40
  )
41
41
 
42
- HTTMultiParty.stub(:post).and_return(HTTPartyProxy.new)
42
+ HTTMultiParty.stub(:post).and_return(ResponseProxy.new)
43
43
  HTTMultiParty.should_receive(:post).with("http://badgerhq.com/github/saladdays/badgerkit.rb/Documentation",
44
44
  :body => {
45
45
  :value => {
@@ -24,4 +24,13 @@ describe Badgerkit do
24
24
 
25
25
  end
26
26
 
27
+ describe '.archive' do
28
+
29
+ it 'should delegate to Badgerkit::Archive#archive' do
30
+ Badgerkit::Archive.should_receive(:archive).with('spec/fixtures/archive_folder/')
31
+ Badgerkit.archive('spec/fixtures/archive_folder/')
32
+ end
33
+
34
+ end
35
+
27
36
  end
@@ -0,0 +1 @@
1
+ test: Value
data/spec/spec_helper.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  require 'coveralls'
4
4
  Coveralls.wear!
5
5
 
6
- require 'support/httparty_proxy'
6
+ require 'support/response_proxy'
7
7
 
8
8
  ## Rspec
9
9
 
@@ -1,5 +1,5 @@
1
1
  # @private
2
- class HTTPartyProxy
2
+ class ResponseProxy
3
3
 
4
4
  attr_reader :parsed_response
5
5
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: badgerkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johan van Zonneveld
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-26 00:00:00.000000000 Z
11
+ date: 2014-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -122,7 +122,7 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
- description: Write a description
125
+ description: Simple api wrapper for submitting data to badgerhq.com
126
126
  email:
127
127
  - johan@vzonneveld.nl
128
128
  executables: []
@@ -140,10 +140,13 @@ files:
140
140
  - lib/badgerkit/archive.rb
141
141
  - lib/badgerkit/client.rb
142
142
  - lib/badgerkit/version.rb
143
+ - spec/badgerkit/archive_spec.rb
143
144
  - spec/badgerkit/client_spec.rb
144
145
  - spec/badgerkit_spec.rb
146
+ - spec/fixtures/archive_folder/test.yml
145
147
  - spec/spec_helper.rb
146
- - spec/support/httparty_proxy.rb
148
+ - spec/support/response_proxy.rb
149
+ - tmp/.keep
147
150
  homepage: https://github.com/saladdays-nl/badgerkit.rb
148
151
  licenses:
149
152
  - MIT
@@ -169,7 +172,9 @@ signing_key:
169
172
  specification_version: 4
170
173
  summary: Toolkit for badgerhq.com
171
174
  test_files:
175
+ - spec/badgerkit/archive_spec.rb
172
176
  - spec/badgerkit/client_spec.rb
173
177
  - spec/badgerkit_spec.rb
178
+ - spec/fixtures/archive_folder/test.yml
174
179
  - spec/spec_helper.rb
175
- - spec/support/httparty_proxy.rb
180
+ - spec/support/response_proxy.rb