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 +4 -4
- data/.gitignore +2 -1
- data/README.md +4 -2
- data/badgerkit.gemspec +1 -1
- data/lib/badgerkit/archive.rb +1 -1
- data/lib/badgerkit/version.rb +1 -1
- data/spec/badgerkit/archive_spec.rb +30 -0
- data/spec/badgerkit/client_spec.rb +1 -1
- data/spec/badgerkit_spec.rb +9 -0
- data/spec/fixtures/archive_folder/test.yml +1 -0
- data/spec/spec_helper.rb +1 -1
- data/spec/support/{httparty_proxy.rb → response_proxy.rb} +1 -1
- metadata +10 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef4d5b0fc6e60ac2ce01bcc9d382ad68594f7f8c
|
4
|
+
data.tar.gz: 3d179b99e463f475c8eaf5d8d30373e9de0d12a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66ba1da53b8df8f79cfcc4d950fafa6ee3b4e5317c7572856e3aa80d1a6c48fcd42f2b564ab48c3806e5b24733a060d184e4982ee446e88cf06c9b9ca513507b
|
7
|
+
data.tar.gz: e101973ccd5bf6cb313c6f17a6dd4e5e3906187c4e332ce426457d2f97743de9508b69c3cd721991ac9c8d7050c8e445984c7cccbea7fb9087675dc2f058b457
|
data/.gitignore
CHANGED
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 = "
|
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
|
|
data/lib/badgerkit/archive.rb
CHANGED
@@ -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
|
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)
|
data/lib/badgerkit/version.rb
CHANGED
@@ -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(
|
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 => {
|
data/spec/badgerkit_spec.rb
CHANGED
@@ -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
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.
|
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-
|
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:
|
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/
|
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/
|
180
|
+
- spec/support/response_proxy.rb
|