pushes 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.rspec +2 -0
- data/Gemfile +2 -0
- data/bin/pushes +2 -0
- data/lib/pushes/config.rb +1 -0
- data/lib/pushes/version.rb +1 -1
- data/pushes.gemspec +3 -5
- data/spec/pushes_spec.rb +38 -0
- data/spec/spec_helper.rb +19 -0
- data/tmp/fake_home/.gitkeep +0 -0
- metadata +12 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a92341786567ea6d356fdf68c08cf3aa1a13eb5d
|
4
|
+
data.tar.gz: a740bad0dfb8fd7e98dd0d08303adc793c9c22fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26f0aacd766e5d9f7c4fef7721677cb44419628a2e6efcf0c8a27b89ce8632b056202f634f8689e13e432d679067d3f9ab924124042aea7c00b0bac0e6b22f5a
|
7
|
+
data.tar.gz: e46eb64305c339b57d10d8fce2abb203102da35aec4aee79306674dd31299605ee4da23e60e41fe73786d3bdb5f38c579d3d555fd6e4d106004a856e04f86138
|
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Gemfile.lock
|
data/.rspec
ADDED
data/Gemfile
ADDED
data/bin/pushes
CHANGED
data/lib/pushes/config.rb
CHANGED
data/lib/pushes/version.rb
CHANGED
data/pushes.gemspec
CHANGED
@@ -11,18 +11,16 @@ spec = Gem::Specification.new do |s|
|
|
11
11
|
s.version = Pushes::VERSION
|
12
12
|
s.platform = Gem::Platform::RUBY
|
13
13
|
|
14
|
-
s.files =
|
15
|
-
s.files += Dir.glob("lib/**/*.rb")
|
16
|
-
s.files += Dir.glob("bin/**/*")
|
17
|
-
s.files += Dir.glob("files/**/*")
|
14
|
+
s.files = `git ls-files`.split($/)
|
18
15
|
|
19
16
|
s.bindir = 'bin'
|
20
17
|
s.executables << 'pushes'
|
21
|
-
|
22
18
|
s.require_paths << 'lib'
|
19
|
+
|
23
20
|
s.add_dependency('octokit', '~> 1.24.0')
|
24
21
|
s.add_dependency('terminal-notifier', '~> 1.4.2')
|
25
22
|
s.add_dependency('highline', '~> 1.6.16')
|
23
|
+
|
26
24
|
s.add_development_dependency('rake')
|
27
25
|
s.add_development_dependency('rspec', '~> 2.13.0')
|
28
26
|
end
|
data/spec/pushes_spec.rb
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Pushes do
|
4
|
+
before :all do
|
5
|
+
@old_stderr = $stderr
|
6
|
+
$stderr = StringIO.new
|
7
|
+
@old_stdout = $stdout
|
8
|
+
$stdout = StringIO.new
|
9
|
+
|
10
|
+
FileUtils.rm_rf(Pushes::Config::PUSHES_FOLDER)
|
11
|
+
end
|
12
|
+
|
13
|
+
after :all do
|
14
|
+
$stderr = @old_stderr
|
15
|
+
$stdout = @old_stdout
|
16
|
+
|
17
|
+
FileUtils.rm_rf(Pushes::Config::PUSHES_FOLDER)
|
18
|
+
end
|
19
|
+
|
20
|
+
before :each do
|
21
|
+
@login = 'foozledoo'
|
22
|
+
@token = '12345'
|
23
|
+
@event_ids = %w(1234 2345 3456 4567 5678)
|
24
|
+
end
|
25
|
+
|
26
|
+
context 'on first run' do
|
27
|
+
it 'prompts for GitHub credentials' do
|
28
|
+
HighLine.any_instance.should_receive(:ask).with('What is your GitHub username? ').and_return(@login)
|
29
|
+
Pushes::Config.any_instance.should_receive(:get_github_token).with(@login).and_return(@token)
|
30
|
+
Pushes.should_receive(:push_events).and_return(@event_ids)
|
31
|
+
Pushes.should_receive(:notify_initiated)
|
32
|
+
Pushes.run %w()
|
33
|
+
|
34
|
+
expect(File.read(Pushes::Config::STORAGE_FILE)).to eq("1234\n2345\n3456\n4567\n5678\n")
|
35
|
+
expect(File.read(Pushes::Config::CONFIG_FILE)).to eq("LOGIN=foozledoo\nTOKEN=12345\n")
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
RSpec.configure do |config|
|
2
|
+
config.treat_symbols_as_metadata_keys_with_true_values = true
|
3
|
+
|
4
|
+
config.before(:all) do
|
5
|
+
return if ENV['CI']
|
6
|
+
|
7
|
+
@original_home = ENV['HOME']
|
8
|
+
fake_home = File.expand_path('./tmp/fake_home')
|
9
|
+
ENV['HOME'] = fake_home
|
10
|
+
|
11
|
+
require 'pushes'
|
12
|
+
end
|
13
|
+
|
14
|
+
config.after(:all) do
|
15
|
+
return if ENV['CI']
|
16
|
+
|
17
|
+
ENV['HOME'] = @original_home
|
18
|
+
end
|
19
|
+
end
|
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pushes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rafael Blais-Masson
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-08-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: octokit
|
@@ -88,17 +88,23 @@ executables:
|
|
88
88
|
extensions: []
|
89
89
|
extra_rdoc_files: []
|
90
90
|
files:
|
91
|
+
- .gitignore
|
92
|
+
- .rspec
|
93
|
+
- Gemfile
|
91
94
|
- LICENSE.md
|
92
95
|
- README.md
|
93
96
|
- Rakefile
|
94
|
-
- pushes
|
97
|
+
- bin/pushes
|
98
|
+
- files/ca.heliom.pushes.plist.erb
|
99
|
+
- lib/pushes.rb
|
95
100
|
- lib/pushes/config.rb
|
96
101
|
- lib/pushes/launch_agent.rb
|
97
102
|
- lib/pushes/notifier.rb
|
98
103
|
- lib/pushes/version.rb
|
99
|
-
-
|
100
|
-
-
|
101
|
-
-
|
104
|
+
- pushes.gemspec
|
105
|
+
- spec/pushes_spec.rb
|
106
|
+
- spec/spec_helper.rb
|
107
|
+
- tmp/fake_home/.gitkeep
|
102
108
|
homepage: https://github.com/heliom/pushes
|
103
109
|
licenses: []
|
104
110
|
metadata: {}
|