easyoperate 0.5.6 → 0.6.0
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.
- data/easyoperate.gemspec +2 -2
- data/lib/eo/eo.rb +4 -3
- data/lib/eo/repository.rb +1 -1
- data/lib/eo.rb +6 -5
- data/lib/version.rb +1 -1
- metadata +2 -2
data/easyoperate.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{easyoperate}
|
5
|
-
s.version = "0.
|
5
|
+
s.version = "0.6.0"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Jinzhu Zhang"]
|
9
|
-
s.date = %q{2009-
|
9
|
+
s.date = %q{2009-05-06}
|
10
10
|
s.default_executable = %q{eo}
|
11
11
|
s.description = %q{Eo_oE}
|
12
12
|
s.email = %q{wosmvp@gmail.com}
|
data/lib/eo/eo.rb
CHANGED
@@ -55,8 +55,9 @@ class Eo
|
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
|
-
def push(args)
|
59
|
-
repos = pick(:key => args,:plural => true,:pushable => true)
|
58
|
+
def push(args,opt={})
|
59
|
+
repos = pick(:key => args,:plural => true,:pushable => true,:skip => opt[:skip])
|
60
|
+
|
60
61
|
repos.each do |x|
|
61
62
|
puts "\e[32m %-18s: Pushing\e[0m" % [x]
|
62
63
|
next if !exist_path(x)
|
@@ -86,7 +87,7 @@ class Eo
|
|
86
87
|
protected
|
87
88
|
#Pick one or more repositories to operate,if single is true only pick one
|
88
89
|
def pick(opt={}) #args,single=true
|
89
|
-
repos = Repos.keys.grep(/#{opt[:key]}/)
|
90
|
+
repos = Repos.keys.grep(/#{opt[:key]}/i)
|
90
91
|
|
91
92
|
if repos.empty?
|
92
93
|
puts("\e[31mNo Result About < #{opt[:key]} >\e[0m")
|
data/lib/eo/repository.rb
CHANGED
@@ -14,7 +14,7 @@ class Repository
|
|
14
14
|
begin
|
15
15
|
scm = opt['scm'] || 'git'
|
16
16
|
require "scm/#{scm.downcase}"
|
17
|
-
extend eval "Scm::#{scm.capitalize}"
|
17
|
+
extend eval "Scm::#{scm.capitalize.gsub(/-(\w)/,$1.to_s.upcase)}"
|
18
18
|
rescue LoadError
|
19
19
|
puts <<-DOC.gsub(/^(\s*\|)/,'')
|
20
20
|
|\e[33m#{self._name_}\e[0m
|
data/lib/eo.rb
CHANGED
@@ -26,16 +26,16 @@ class Eo
|
|
26
26
|
when /^-gc$/i then gemshell(params)
|
27
27
|
when /^-go$/i then gemopen(params)
|
28
28
|
|
29
|
-
when /^-s\w?$/i then show(params
|
30
|
-
when /^-i\w?$/i then init(params
|
29
|
+
when /^-s\w?$/i then show(params, :skip => (args[0] =~ /^-sa$/).nil?)
|
30
|
+
when /^-i\w?$/i then init(params, :skip => (args[0] =~ /^-ia$/).nil?)
|
31
31
|
when /^-u\w?$/i then update(params,:skip => (args[0] =~ /^-ua$/).nil?)
|
32
|
+
when /^-p\w?$/i then push(params, :skip => (args[0] =~ /^-pa$/).nil?)
|
32
33
|
|
33
34
|
when /^-o$/i then open(params)
|
34
35
|
when /^-c$/i then choose(params)
|
35
36
|
when /^-d$/i then delete(params)
|
36
37
|
|
37
38
|
when /^-t$/i then type
|
38
|
-
when /^-p$/i then push(params)
|
39
39
|
when /^-v$/i then puts "\e[33mEo_oE : v#{Easyoperate::VERSION}\e[0m"
|
40
40
|
when /^-(h|help)$/i then help
|
41
41
|
else self.run
|
@@ -51,9 +51,10 @@ class Eo
|
|
51
51
|
when /^GC$/i then gemshell(input[1])
|
52
52
|
when /^GO$/i then gemopen(input[1])
|
53
53
|
|
54
|
-
when /^S\w?/i then show(input[1]
|
55
|
-
when /^I\w?/i then init(input[1]
|
54
|
+
when /^S\w?/i then show(input[1], :skip =>(input[0] =~ /^sa$/i).nil?)
|
55
|
+
when /^I\w?/i then init(input[1], :skip =>(input[0] =~ /^ia$/i).nil?)
|
56
56
|
when /^U\w?/i then update(input[1],:skip =>(input[0] =~ /^ua$/i).nil?)
|
57
|
+
when /^P\w?/i then push(input[1], :skip =>(input[0] =~ /^pa$/i).nil?)
|
57
58
|
|
58
59
|
when /^O$/i then open(input[1])
|
59
60
|
when /^C$/i then choose(input[1])
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easyoperate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jinzhu Zhang
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-05-06 00:00:00 +08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|