hgrc_generator 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
- checksums.yaml.gz.sig +0 -0
- data/lib/hgrc_generator/core.rb +6 -3
- data/lib/hgrc_generator/params.rb +3 -1
- data/lib/hgrc_generator/version.rb +1 -1
- data/lib/hgrc_generator.rb +1 -0
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce78b0cc7176ea176ca5b47b47698d63a6ac592b
|
4
|
+
data.tar.gz: 6ac856a27d6aeead59fc29f959b7f787bd2589d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e8915301c1f413e3da3694eba27de0511357976a5ef6f33d6cd0696d4f3ac5d523674cdc41df386f7e94ce33f9a4504f08d815d29980c752bbb54593d378d43
|
7
|
+
data.tar.gz: fc78e9b14eea3b08535435ef5a959b447d134f9ce9ff2e33e4590b72a1dec771fd18e57103649e41944e863d44e3878f0650882d4988c909b30912ae216b9444
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/hgrc_generator/core.rb
CHANGED
@@ -8,20 +8,23 @@ module HgrcGenerator
|
|
8
8
|
module Core
|
9
9
|
extend self
|
10
10
|
|
11
|
+
HGRC_PATH = '.hg/hgrc'
|
12
|
+
|
11
13
|
def run(args)
|
12
14
|
params = Params.new(args)
|
15
|
+
|
13
16
|
if !File.directory?('.hg')
|
14
17
|
puts 'The current path does not appear to be the root ' +
|
15
18
|
'of a Mercurial repo - .hg folder does not exist.'
|
16
19
|
else
|
17
|
-
if File.file?(
|
18
|
-
puts
|
20
|
+
if File.file?(HGRC_PATH) && !params.dry_run
|
21
|
+
puts "#{HGRC_PATH} already exists."
|
19
22
|
else
|
20
23
|
contents = Content.create(params)
|
21
24
|
if params.dry_run
|
22
25
|
puts contents
|
23
26
|
else
|
24
|
-
File.write
|
27
|
+
File.write HGRC_PATH, contents
|
25
28
|
end
|
26
29
|
end
|
27
30
|
end
|
@@ -3,7 +3,9 @@ module HgrcGenerator
|
|
3
3
|
attr_reader :include_prefix, :branches, :dry_run, :help
|
4
4
|
|
5
5
|
HELP = <<-DOC
|
6
|
-
|
6
|
+
hgrc_generator version #{HgrcGenerator::VERSION}
|
7
|
+
|
8
|
+
Usage: hgrc_generator [--include-prefix] [--dry_run] BRANCH_LIST
|
7
9
|
|
8
10
|
Create an hgrc file for the currrent project.
|
9
11
|
|
data/lib/hgrc_generator.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|