git_fetcher 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YmZlNDQ3YzUzOGQzMzBlNTU4ZGRlYjMyZWY5NjYxMTJlZGM1MTEwOA==
5
+ data.tar.gz: !binary |-
6
+ YTUwNzEzMmY5ZWVkN2FhMmRiMTI3YzgyNjBkNjY4MTM3OTY5YjVlNA==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ ZGE0ZWZlY2NkZWIwNWE3ODAwZDdkNzU1ZGM4ZWVhZjY4ODg2NzhkMjBjYzE4
10
+ YTdjYTkwZGMzMTdlYTZiYjVlYjBkNTdlZWJjMGI1MjQ4NjllYWFiMmI0NGJl
11
+ ZjVjNGIwY2ZiNDM1MzEwYTY4ZTVmZTQ5Yjk5ZWQxYmJkZTRmNTY=
12
+ data.tar.gz: !binary |-
13
+ NGQxMmFhZDJlZDRkN2Y3ODZmM2Q4MWIzZjRiMDRlZTBkYTA5NzNjMjUxMzA1
14
+ NmUxZWQ0M2FlOGU2MDdlNzJjMjEzZmM0MDZmYmJmNTgwYjU1YjlhYmNmNjVm
15
+ YWJmZDcxMDkxYTZkOGY5ODZlYTNiNzUxZDA1YTFhOGMwMGNjMTA=
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
data/Gemfile ADDED
@@ -0,0 +1,13 @@
1
+ source "http://rubygems.org"
2
+ # Add dependencies required to use your gem here.
3
+ # Example:
4
+ # gem "activesupport", ">= 2.3.5"
5
+
6
+ # Add dependencies to develop your gem here.
7
+ # Include everything needed to run rake, tests, features, etc.
8
+ group :development do
9
+ gem "shoulda", ">= 0"
10
+ gem "rdoc", "~> 3.12"
11
+ gem "bundler", "~> 1.0"
12
+ gem "jeweler", "~> 1.8.7"
13
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,72 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ activesupport (4.0.1)
5
+ i18n (~> 0.6, >= 0.6.4)
6
+ minitest (~> 4.2)
7
+ multi_json (~> 1.3)
8
+ thread_safe (~> 0.1)
9
+ tzinfo (~> 0.3.37)
10
+ addressable (2.3.5)
11
+ atomic (1.1.14)
12
+ builder (3.2.2)
13
+ faraday (0.8.8)
14
+ multipart-post (~> 1.2.0)
15
+ git (1.2.6)
16
+ github_api (0.10.1)
17
+ addressable
18
+ faraday (~> 0.8.1)
19
+ hashie (>= 1.2)
20
+ multi_json (~> 1.4)
21
+ nokogiri (~> 1.5.2)
22
+ oauth2
23
+ hashie (2.0.5)
24
+ highline (1.6.20)
25
+ httpauth (0.2.0)
26
+ i18n (0.6.5)
27
+ jeweler (1.8.8)
28
+ builder
29
+ bundler (~> 1.0)
30
+ git (>= 1.2.5)
31
+ github_api (= 0.10.1)
32
+ highline (>= 1.6.15)
33
+ nokogiri (= 1.5.10)
34
+ rake
35
+ rdoc
36
+ json (1.8.1)
37
+ jwt (0.1.8)
38
+ multi_json (>= 1.5)
39
+ minitest (4.7.5)
40
+ multi_json (1.8.2)
41
+ multi_xml (0.5.5)
42
+ multipart-post (1.2.0)
43
+ nokogiri (1.5.10)
44
+ oauth2 (0.9.2)
45
+ faraday (~> 0.8)
46
+ httpauth (~> 0.2)
47
+ jwt (~> 0.1.4)
48
+ multi_json (~> 1.0)
49
+ multi_xml (~> 0.5)
50
+ rack (~> 1.2)
51
+ rack (1.5.2)
52
+ rake (10.1.0)
53
+ rdoc (3.12.2)
54
+ json (~> 1.4)
55
+ shoulda (3.5.0)
56
+ shoulda-context (~> 1.0, >= 1.0.1)
57
+ shoulda-matchers (>= 1.4.1, < 3.0)
58
+ shoulda-context (1.1.6)
59
+ shoulda-matchers (2.4.0)
60
+ activesupport (>= 3.0.0)
61
+ thread_safe (0.1.3)
62
+ atomic
63
+ tzinfo (0.3.38)
64
+
65
+ PLATFORMS
66
+ ruby
67
+
68
+ DEPENDENCIES
69
+ bundler (~> 1.0)
70
+ jeweler (~> 1.8.7)
71
+ rdoc (~> 3.12)
72
+ shoulda
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2013 Yuri Kovalov
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,27 @@
1
+ = git_fetcher
2
+
3
+ [http://blog.yurikoval.com/git_fetcher](http://blog.yurikoval.com/git_fetcher)
4
+
5
+ == Installation
6
+
7
+ gem install git_fetcher
8
+
9
+ == Usage
10
+
11
+ git-fetcher /path/to/your/development/directory
12
+
13
+ This will fetch from all remote sources for git repos in that directory. Essentially the same as going into every directory and running `git remote update` or `git fetch --all`.
14
+
15
+ == Contributing to git_fetcher
16
+
17
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
18
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
19
+ * Fork the project.
20
+ * Start a feature/bugfix branch.
21
+ * Commit and push until you are happy with your contribution.
22
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
23
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
24
+
25
+ == Copyright
26
+
27
+ Copyright (c) 2013 Yuri Kovalov. MIT License
data/Rakefile ADDED
@@ -0,0 +1,47 @@
1
+ # encoding: utf-8
2
+
3
+ require 'rubygems'
4
+ require 'bundler'
5
+ begin
6
+ Bundler.setup(:default, :development)
7
+ rescue Bundler::BundlerError => e
8
+ $stderr.puts e.message
9
+ $stderr.puts "Run `bundle install` to install missing gems"
10
+ exit e.status_code
11
+ end
12
+ require 'rake'
13
+
14
+ require 'jeweler'
15
+ Jeweler::Tasks.new do |gem|
16
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
17
+ gem.name = "git_fetcher"
18
+ gem.homepage = "http://blog.yurikoval.com/git_fetcher"
19
+ gem.license = "MIT"
20
+ gem.summary = %Q{Run git fetch on all your projects.}
21
+ gem.description = %Q{Crawl and find git repos in your directory and perform a fetch on all remote sources.}
22
+ gem.email = "yuri@yurikoval.com"
23
+ gem.authors = ["Yuri Kovalov"]
24
+ gem.require_paths = ["lib"]
25
+ gem.executables = ['git-fetcher']
26
+ gem.files = `git ls-files`.split("\n")
27
+ gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
28
+ # dependencies defined in Gemfile
29
+ end
30
+ Jeweler::RubygemsDotOrgTasks.new
31
+
32
+ require 'rake/testtask'
33
+ Rake::TestTask.new(:test) do |test|
34
+ test.libs << 'lib' << 'test'
35
+ test.pattern = 'test/**/test_*.rb'
36
+ test.verbose = true
37
+ end
38
+
39
+ require 'rdoc/task'
40
+ Rake::RDocTask.new do |rdoc|
41
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
42
+
43
+ rdoc.rdoc_dir = 'rdoc'
44
+ rdoc.title = "git_fetcher #{version}"
45
+ rdoc.rdoc_files.include('README*')
46
+ rdoc.rdoc_files.include('lib/**/*.rb')
47
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0
data/bin/git-fetcher ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'git_fetcher'
4
+ GitFetcher::Runner.execute(*ARGV)
@@ -0,0 +1,64 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = "git_fetcher"
8
+ s.version = "0.1.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Yuri Kovalov"]
12
+ s.date = "2013-11-13"
13
+ s.description = "Crawl and find git repos in your directory and perform a fetch on all remote sources."
14
+ s.email = "yuri@yurikoval.com"
15
+ s.executables = ["git-fetcher"]
16
+ s.extra_rdoc_files = [
17
+ "LICENSE.txt",
18
+ "README.md"
19
+ ]
20
+ s.files = [
21
+ ".document",
22
+ "Gemfile",
23
+ "Gemfile.lock",
24
+ "LICENSE.txt",
25
+ "README.md",
26
+ "Rakefile",
27
+ "VERSION",
28
+ "bin/git-fetcher",
29
+ "git_fetcher.gemspec",
30
+ "lib/git_fetcher.rb",
31
+ "lib/git_fetcher/runner.rb",
32
+ "lib/git_fetcher/version.rb",
33
+ "test/helper.rb",
34
+ "test/test_git_fetcher.rb"
35
+ ]
36
+ s.homepage = "http://blog.yurikoval.com/git_fetcher"
37
+ s.licenses = ["MIT"]
38
+ s.require_paths = ["lib"]
39
+ s.rubygems_version = "2.0.7"
40
+ s.summary = "Run git fetch on all your projects."
41
+ s.test_files = ["test/helper.rb", "test/test_git_fetcher.rb"]
42
+
43
+ if s.respond_to? :specification_version then
44
+ s.specification_version = 4
45
+
46
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
47
+ s.add_development_dependency(%q<shoulda>, [">= 0"])
48
+ s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
49
+ s.add_development_dependency(%q<bundler>, ["~> 1.0"])
50
+ s.add_development_dependency(%q<jeweler>, ["~> 1.8.7"])
51
+ else
52
+ s.add_dependency(%q<shoulda>, [">= 0"])
53
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
54
+ s.add_dependency(%q<bundler>, ["~> 1.0"])
55
+ s.add_dependency(%q<jeweler>, ["~> 1.8.7"])
56
+ end
57
+ else
58
+ s.add_dependency(%q<shoulda>, [">= 0"])
59
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
60
+ s.add_dependency(%q<bundler>, ["~> 1.0"])
61
+ s.add_dependency(%q<jeweler>, ["~> 1.8.7"])
62
+ end
63
+ end
64
+
@@ -0,0 +1,51 @@
1
+ module GitFetcher
2
+ module Runner
3
+ def self.execute(cmd_arg = '.', *args)
4
+ if cmd_arg.match /^\-+h/
5
+ send('help', *args)
6
+ else
7
+ send('fetch', cmd_arg)
8
+ end
9
+ end
10
+
11
+ def self.is_git_repo
12
+ %x[git rev-parse 2>&1]
13
+ $?.exitstatus == 0
14
+ end
15
+
16
+ def self.fetch(*args)
17
+ dir_to_scan = if args[0]
18
+ if args[0] !~ /^\//
19
+ File.join(Dir.pwd, args[0])
20
+ else
21
+ args[0]
22
+ end
23
+ else
24
+ Dir.pwd
25
+ end
26
+
27
+ repos = Dir.entries(dir_to_scan).select {|f| File.directory?(File.join(dir_to_scan, f)) && !f.match(/^\.+$/) }
28
+
29
+ repos.each do |d|
30
+ repo_to_update = File.join(dir_to_scan, d)
31
+ Dir.chdir repo_to_update
32
+ if is_git_repo
33
+ puts "Updating #{d}."
34
+ %x[git remote update]
35
+ end
36
+ end
37
+ end
38
+
39
+ def self.help
40
+ puts <<-HELP
41
+ git-fetcher #{VERSION} is installed.
42
+
43
+ Usage:
44
+ git-fetcher [DIRECTORY]
45
+
46
+ git-fetcher will crawl through your directory and find any repos and perform a fetch on all remote sources.
47
+ HELP
48
+ end
49
+ end
50
+
51
+ end
@@ -0,0 +1,3 @@
1
+ module GitFetcher
2
+ VERSION = '0.1.0'
3
+ end
@@ -0,0 +1,2 @@
1
+ require 'git_fetcher/version'
2
+ require 'git_fetcher/runner'
data/test/helper.rb ADDED
@@ -0,0 +1,18 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ begin
4
+ Bundler.setup(:default, :development)
5
+ rescue Bundler::BundlerError => e
6
+ $stderr.puts e.message
7
+ $stderr.puts "Run `bundle install` to install missing gems"
8
+ exit e.status_code
9
+ end
10
+ require 'test/unit'
11
+ require 'shoulda'
12
+
13
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
14
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
15
+ require 'git_fetcher'
16
+
17
+ class Test::Unit::TestCase
18
+ end
@@ -0,0 +1,7 @@
1
+ require 'helper'
2
+
3
+ class TestGitFetcher < Test::Unit::TestCase
4
+ should "probably rename this file and start testing for real" do
5
+ flunk "hey buddy, you should probably rename this file and start testing for real"
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,119 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: git_fetcher
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Yuri Kovalov
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-11-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: shoulda
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ! '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ! '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rdoc
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '3.12'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '3.12'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '1.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '1.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: jeweler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 1.8.7
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: 1.8.7
69
+ description: Crawl and find git repos in your directory and perform a fetch on all
70
+ remote sources.
71
+ email: yuri@yurikoval.com
72
+ executables:
73
+ - git-fetcher
74
+ extensions: []
75
+ extra_rdoc_files:
76
+ - LICENSE.txt
77
+ - README.md
78
+ files:
79
+ - .document
80
+ - Gemfile
81
+ - Gemfile.lock
82
+ - LICENSE.txt
83
+ - README.md
84
+ - Rakefile
85
+ - VERSION
86
+ - bin/git-fetcher
87
+ - git_fetcher.gemspec
88
+ - lib/git_fetcher.rb
89
+ - lib/git_fetcher/runner.rb
90
+ - lib/git_fetcher/version.rb
91
+ - test/helper.rb
92
+ - test/test_git_fetcher.rb
93
+ homepage: http://blog.yurikoval.com/git_fetcher
94
+ licenses:
95
+ - MIT
96
+ metadata: {}
97
+ post_install_message:
98
+ rdoc_options: []
99
+ require_paths:
100
+ - lib
101
+ required_ruby_version: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - ! '>='
104
+ - !ruby/object:Gem::Version
105
+ version: '0'
106
+ required_rubygems_version: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ! '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ requirements: []
112
+ rubyforge_project:
113
+ rubygems_version: 2.0.7
114
+ signing_key:
115
+ specification_version: 4
116
+ summary: Run git fetch on all your projects.
117
+ test_files:
118
+ - test/helper.rb
119
+ - test/test_git_fetcher.rb