nkryptic-gitstart 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,6 +2,14 @@
2
2
 
3
3
  Based upon http://github.com/gma/git-me-up
4
4
 
5
+ == Install
6
+
7
+ sudo gem install nkryptic-gitstart -s http://gem.github.com
8
+
9
+ == Usage
10
+
11
+ gitstart <svn-repository> <target-directory>
12
+
5
13
  == Note on Patches/Pull Requests
6
14
 
7
15
  * Fork the project.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.2.0
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), *%w( .. lib ))
4
+ require 'gitstart'
5
+
6
+ Gitstart::Status.status_with_externals
@@ -0,0 +1,60 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE
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 = %q{gitstart}
8
+ s.version = "0.2.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["nkryptic"]
12
+ s.date = %q{2009-09-12}
13
+ s.description = %q{Initialize a git-svn clone of a repository including svn:externals}
14
+ s.email = %q{nkryptic@gmail.com}
15
+ s.executables = ["gitstart", "gitstart-status"]
16
+ s.extra_rdoc_files = [
17
+ "LICENSE",
18
+ "README.rdoc"
19
+ ]
20
+ s.files = [
21
+ ".document",
22
+ ".gitignore",
23
+ "LICENSE",
24
+ "README.rdoc",
25
+ "Rakefile",
26
+ "VERSION",
27
+ "bin/gitstart",
28
+ "bin/gitstart-status",
29
+ "gitstart.gemspec",
30
+ "lib/gitstart.rb",
31
+ "spec/gitstart_spec.rb",
32
+ "spec/spec_helper.rb"
33
+ ]
34
+ s.has_rdoc = true
35
+ s.homepage = %q{http://github.com/nkryptic/gitstart}
36
+ s.rdoc_options = ["--charset=UTF-8"]
37
+ s.require_paths = ["lib"]
38
+ s.rubygems_version = %q{1.3.1}
39
+ s.summary = %q{Initialize a git-svn clone of a repository including svn:externals}
40
+ s.test_files = [
41
+ "spec/gitstart_spec.rb",
42
+ "spec/spec_helper.rb"
43
+ ]
44
+
45
+ if s.respond_to? :specification_version then
46
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
47
+ s.specification_version = 2
48
+
49
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
50
+ s.add_development_dependency(%q<rspec>, [">= 0"])
51
+ s.add_development_dependency(%q<yard>, [">= 0"])
52
+ else
53
+ s.add_dependency(%q<rspec>, [">= 0"])
54
+ s.add_dependency(%q<yard>, [">= 0"])
55
+ end
56
+ else
57
+ s.add_dependency(%q<rspec>, [">= 0"])
58
+ s.add_dependency(%q<yard>, [">= 0"])
59
+ end
60
+ end
@@ -1,4 +1,5 @@
1
1
  require 'fileutils'
2
+ require 'yaml'
2
3
 
3
4
  module Gitstart
4
5
 
@@ -97,6 +98,10 @@ module Gitstart
97
98
  def checkout(branch_name)
98
99
  `git checkout -b #{branch_name} 2>/dev/null`
99
100
  end
101
+
102
+ def status
103
+ `git status 2>&1`
104
+ end
100
105
  end
101
106
 
102
107
  module GitSvn
@@ -117,6 +122,51 @@ module Gitstart
117
122
  end
118
123
  end
119
124
 
125
+ module Status
126
+ extend self
127
+ extend Help
128
+
129
+ def status
130
+ target = Dir.pwd
131
+
132
+ unless File.directory?('.git')
133
+ ui.puts "#{target} does not appear to be a git repository"
134
+ exit 1
135
+ end
136
+
137
+ ui.puts "Status for project at #{target}:"
138
+ ui.indent
139
+ ui.puts *Sh::Git.status.split("\n")
140
+ ui.unindent
141
+ ui.puts
142
+ end
143
+
144
+ def status_with_externals
145
+ status
146
+
147
+ external_info_file = '.externals/externals_info.yaml'
148
+ unless File.exist?(external_info_file)
149
+ ui.puts "cannot locate the #{external_info_file} to load externals"
150
+ exit 1
151
+ end
152
+
153
+ externals = YAML.load(File.open(external_info_file))
154
+
155
+ externals.each do |dir, repos|
156
+ repos.each do |ext_dir, ext_repo|
157
+ target = File.join(dir, ext_dir)
158
+ ui.puts "Status for external at #{target}:"
159
+ Dir.chdir(target) do
160
+ ui.indent
161
+ ui.puts *Sh::Git.status.split("\n")
162
+ ui.unindent
163
+ end
164
+ ui.puts
165
+ end
166
+ end
167
+ end
168
+ end
169
+
120
170
  module Application
121
171
  extend self
122
172
  extend Help
@@ -217,6 +267,10 @@ module Gitstart
217
267
  File.open('.git/info/exclude', 'a') { |f| f.puts File.join(dir, ext_dir) }
218
268
  end
219
269
  end
270
+
271
+ File.open( File.join(externals_dir, 'externals_info.yaml'), 'w' ) do |out|
272
+ YAML.dump( externals, out )
273
+ end
220
274
  end
221
275
 
222
276
  ui.unindent
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nkryptic-gitstart
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - nkryptic
@@ -10,7 +10,7 @@ bindir: bin
10
10
  cert_chain: []
11
11
 
12
12
  date: 2009-09-12 00:00:00 -07:00
13
- default_executable: gitstart
13
+ default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec
@@ -36,6 +36,7 @@ description: Initialize a git-svn clone of a repository including svn:externals
36
36
  email: nkryptic@gmail.com
37
37
  executables:
38
38
  - gitstart
39
+ - gitstart-status
39
40
  extensions: []
40
41
 
41
42
  extra_rdoc_files:
@@ -49,12 +50,13 @@ files:
49
50
  - Rakefile
50
51
  - VERSION
51
52
  - bin/gitstart
53
+ - bin/gitstart-status
54
+ - gitstart.gemspec
52
55
  - lib/gitstart.rb
53
56
  - spec/gitstart_spec.rb
54
57
  - spec/spec_helper.rb
55
58
  has_rdoc: true
56
59
  homepage: http://github.com/nkryptic/gitstart
57
- licenses:
58
60
  post_install_message:
59
61
  rdoc_options:
60
62
  - --charset=UTF-8
@@ -75,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
75
77
  requirements: []
76
78
 
77
79
  rubyforge_project:
78
- rubygems_version: 1.3.5
80
+ rubygems_version: 1.2.0
79
81
  signing_key:
80
82
  specification_version: 2
81
83
  summary: Initialize a git-svn clone of a repository including svn:externals