pushes 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e6a4ad6c54d208aa4a8acbb4546d56b585ea5310
4
- data.tar.gz: 44082e52668200352b289e08228279dde0ba391b
3
+ metadata.gz: a92341786567ea6d356fdf68c08cf3aa1a13eb5d
4
+ data.tar.gz: a740bad0dfb8fd7e98dd0d08303adc793c9c22fe
5
5
  SHA512:
6
- metadata.gz: f6e188fe64d70b2bc9618391f3ba6ddf28a35a5a836e9dc1fd073962b0c9127b472d08959512ba581c223fcb08082f68e261dad83588b6c9a5d94e597491bb36
7
- data.tar.gz: 4d95aafb9d9ac674cf07a3b34f2ff2b03e5a80197a1a491d71601e84b70cbf115d231d026e5a8a15434831436d4db7264a040a58997693bb23b1e51299c702e9
6
+ metadata.gz: 26f0aacd766e5d9f7c4fef7721677cb44419628a2e6efcf0c8a27b89ce8632b056202f634f8689e13e432d679067d3f9ab924124042aea7c00b0bac0e6b22f5a
7
+ data.tar.gz: e46eb64305c339b57d10d8fce2abb203102da35aec4aee79306674dd31299605ee4da23e60e41fe73786d3bdb5f38c579d3d555fd6e4d106004a856e04f86138
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ Gemfile.lock
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format progress
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source 'http://rubygems.org'
2
+ gemspec
data/bin/pushes CHANGED
@@ -1,4 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
+ $:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
4
+
3
5
  require 'pushes'
4
6
  exit Pushes.run(ARGV)
data/lib/pushes/config.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'json'
2
+ require 'fileutils'
2
3
  require 'highline/import'
3
4
 
4
5
  class Pushes::Config
@@ -1,3 +1,3 @@
1
1
  module Pushes
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
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 = %w(LICENSE.md README.md Rakefile pushes.gemspec)
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
@@ -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
@@ -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.2
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-05-21 00:00:00.000000000 Z
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.gemspec
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
- - lib/pushes.rb
100
- - bin/pushes
101
- - files/ca.heliom.pushes.plist.erb
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: {}