pullable 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3ef0cd1d416f4f1f040ff799a1756146fe49285f
4
+ data.tar.gz: f15c85ca5c69a373a03dea704ed01fdbfe88e227
5
+ SHA512:
6
+ metadata.gz: 97b79001d32736e04452586fec03ea1bb9dff6405389d002d320bed48d7fe527e02272e8b447738cadaab294e19a64a409729aae892507e306795042f818f339
7
+ data.tar.gz: baec7dcba6d72c7deb66eca14180a025a7253408b50559fd7832463c556dbb0bae2e0fbf58f81d2ba29f115885ed8816dc391829d1d579a35cc1f5e4a186addc
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.ruby-gemset ADDED
@@ -0,0 +1 @@
1
+ pullable
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ ruby-2.0.0-p0
data/.travis.yml ADDED
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in pullable.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,24 @@
1
+ This is free and unencumbered software released into the public domain.
2
+
3
+ Anyone is free to copy, modify, publish, use, compile, sell, or
4
+ distribute this software, either in source code form or as a compiled
5
+ binary, for any purpose, commercial or non-commercial, and by any
6
+ means.
7
+
8
+ In jurisdictions that recognize copyright laws, the author or authors
9
+ of this software dedicate any and all copyright interest in the
10
+ software to the public domain. We make this dedication for the benefit
11
+ of the public at large and to the detriment of our heirs and
12
+ successors. We intend this dedication to be an overt act of
13
+ relinquishment in perpetuity of all present and future rights to this
14
+ software under copyright law.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
23
+
24
+ For more information, please refer to <http://unlicense.org/>
data/README.md ADDED
@@ -0,0 +1,32 @@
1
+ # Pullable
2
+
3
+ Loop over a directory of Git repositories, fetch, and fast-forward merge from
4
+ origin.
5
+
6
+ ## Installation
7
+
8
+ Add this line to your application's Gemfile:
9
+
10
+ gem 'pullable'
11
+
12
+ And then execute:
13
+
14
+ $ bundle
15
+
16
+ Or install it yourself as:
17
+
18
+ $ gem install pullable
19
+
20
+ ## Usage
21
+
22
+ ```ruby
23
+ pullable ~/Projects
24
+ ```
25
+
26
+ ## Contributing
27
+
28
+ 1. Fork it
29
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
30
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
31
+ 4. Push to the branch (`git push origin my-new-feature`)
32
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/pullable ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'pullable'
4
+
5
+ Pullable.process!(ARGF.argv[0])
@@ -0,0 +1,3 @@
1
+ module Pullable
2
+ VERSION = "0.0.1"
3
+ end
data/lib/pullable.rb ADDED
@@ -0,0 +1,42 @@
1
+ require "pullable/version"
2
+ require "fileutils"
3
+
4
+ SKIPPED_DIRECTORIES = ['.DS_Store']
5
+
6
+ module Pullable
7
+
8
+ def self.process!(root)
9
+ pulled, skipped, failed = [], [], []
10
+
11
+ raise ArgumentError.new("Please pass a root directoy!") if root.nil?
12
+ raise ArgumentError.new("Please pass a valid root directoy!") unless File.directory?(root)
13
+
14
+ Dir.foreach(root) do |directory|
15
+ if File.directory?(directory)
16
+ unless SKIPPED_DIRECTORIES.include?(directory)
17
+ FileUtils.cd(directory)
18
+
19
+ if File.directory?('.git')
20
+ puts "Pulling:\t#{directory}"
21
+ `git fetch -p`
22
+ `git merge --ff-only origin/master`
23
+ end
24
+
25
+ unless $?.success?
26
+ failed << directory
27
+ else
28
+ pulled << directory
29
+ end
30
+
31
+ FileUtils.cd(root)
32
+ end
33
+ else
34
+ skipped << directory
35
+ end
36
+ end
37
+
38
+ puts "Pulled:\t\t#{pulled.inspect}" unless pulled.empty?
39
+ puts "Skipped:\t#{skipped.inspect}" unless skipped.empty?
40
+ puts "Failed:\t\t#{failed.inspect}" unless failed.empty?
41
+ end
42
+ end
data/pullable.gemspec ADDED
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'pullable/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "pullable"
8
+ spec.version = Pullable::VERSION
9
+ spec.authors = ["Duncan Grazier"]
10
+ spec.email = ["itsmeduncan@gmail.com"]
11
+ spec.description = %q{Update your Git repositories}
12
+ spec.summary = %q{A simple tool to update your local repositories}
13
+ spec.homepage = "https://github.com/itsmeduncan/pullable"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.3"
22
+ spec.add_development_dependency "rake"
23
+ spec.add_development_dependency "rspec"
24
+ end
@@ -0,0 +1,9 @@
1
+ require 'spec_helper'
2
+
3
+ describe Pullable do
4
+
5
+ it 'should have a version number' do
6
+ Pullable::VERSION.should_not be_nil
7
+ end
8
+
9
+ end
@@ -0,0 +1,2 @@
1
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
+ require 'pullable'
metadata ADDED
@@ -0,0 +1,104 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pullable
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Duncan Grazier
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-09-03 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: Update your Git repositories
56
+ email:
57
+ - itsmeduncan@gmail.com
58
+ executables:
59
+ - pullable
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - .gitignore
64
+ - .rspec
65
+ - .ruby-gemset
66
+ - .ruby-version
67
+ - .travis.yml
68
+ - Gemfile
69
+ - LICENSE.txt
70
+ - README.md
71
+ - Rakefile
72
+ - bin/pullable
73
+ - lib/pullable.rb
74
+ - lib/pullable/version.rb
75
+ - pullable.gemspec
76
+ - spec/pullable_spec.rb
77
+ - spec/spec_helper.rb
78
+ homepage: https://github.com/itsmeduncan/pullable
79
+ licenses:
80
+ - MIT
81
+ metadata: {}
82
+ post_install_message:
83
+ rdoc_options: []
84
+ require_paths:
85
+ - lib
86
+ required_ruby_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - '>='
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ required_rubygems_version: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - '>='
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ requirements: []
97
+ rubyforge_project:
98
+ rubygems_version: 2.0.3
99
+ signing_key:
100
+ specification_version: 4
101
+ summary: A simple tool to update your local repositories
102
+ test_files:
103
+ - spec/pullable_spec.rb
104
+ - spec/spec_helper.rb