metaverse 0.1.10 → 0.2.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -1
- data/README.md +0 -17
- data/bin/meta +4 -2
- data/lib/metaverse/base.rb +13 -122
- data/lib/metaverse/cli.rb +3 -30
- data/lib/metaverse/iterator.rb +0 -4
- data/lib/metaverse/repo.rb +22 -119
- data/lib/metaverse/version.rb +1 -1
- data/metaverse.gemspec +0 -2
- metadata +4 -33
- data/lib/metaverse/errors.rb +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 728ccb915c07d528cb4aa047d5cbfe124921733a
|
4
|
+
data.tar.gz: 8b29aa1a599b73554f73730be8a66905de367af9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb818e909547acce5e08080770f4675148a9397770fc437fa61fe3edb35db96f6cdae82f2705317ee7dd9b688da6894fca09f46de840c852f0a14078c69eb72d
|
7
|
+
data.tar.gz: 0ded1e37a022419ddc622f0e0497350ed4c06c38d5e8fcd3fe176c13b2e9d1fa006c89a2b04f0cfbe3cfdc603f1c81fdcc83ff5abbec12655e53ab9ce019b5d1
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -5,17 +5,6 @@ Metaverse multirepo management revolves around two main axes of functionality:
|
|
5
5
|
* Workflow related functionality
|
6
6
|
* State Management
|
7
7
|
|
8
|
-
# Installation
|
9
|
-
|
10
|
-
Metaverse requires `rugged` which in turns relies on a bundled `libgit2` which
|
11
|
-
is a Ruby native extension.
|
12
|
-
|
13
|
-
### OSX
|
14
|
-
|
15
|
-
You need Cmake and pkg-config. If you have brew you can install by running :
|
16
|
-
|
17
|
-
`brew install cmake pkg-config`
|
18
|
-
|
19
8
|
# 1 - Workflow
|
20
9
|
## Utilities
|
21
10
|
### Checkout
|
@@ -42,12 +31,6 @@ Pulls the changes from the main remote in every repo - similar to `git pull orig
|
|
42
31
|
|
43
32
|
Displays the branch at which every repo is.
|
44
33
|
|
45
|
-
### Exec
|
46
|
-
`meta exec COMMAND`
|
47
|
-
|
48
|
-
Runs the specified shell command in every repo's working directory. Also passes
|
49
|
-
the ENV used to invoke it to the shell command.
|
50
|
-
|
51
34
|
## Features
|
52
35
|
### New
|
53
36
|
`meta feature new FEATURE_NAME`
|
data/bin/meta
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
begin
|
4
|
-
require
|
4
|
+
require "bundler/setup"
|
5
|
+
require 'metaverse'
|
5
6
|
rescue LoadError
|
7
|
+
require "bundler/setup"
|
6
8
|
require 'rubygems'
|
7
|
-
require
|
9
|
+
require 'metaverse'
|
8
10
|
end
|
9
11
|
|
10
12
|
Metaverse::Cli.start
|
data/lib/metaverse/base.rb
CHANGED
@@ -1,60 +1,26 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'colorize'
|
3
3
|
require 'yaml'
|
4
|
-
require 'transacted'
|
5
4
|
require 'metaverse/repo'
|
6
5
|
require 'metaverse/iterator'
|
7
|
-
require 'metaverse/errors'
|
8
6
|
|
9
7
|
module Metaverse
|
10
8
|
class Base
|
11
9
|
def initialize path
|
12
10
|
@logger = Logger.new STDOUT
|
13
|
-
@base_path = path
|
14
11
|
read_config "#{path}/.meta.yml"
|
15
|
-
@repos_paths = Metaverse::Iterator.new path, @ignored_repos
|
16
|
-
|
17
|
-
@repos_paths.build
|
18
|
-
save_config "#{path}/.meta.yml"
|
19
|
-
puts "Repos cache built.".green
|
20
|
-
end
|
12
|
+
@repos_paths = Metaverse::Iterator.new path, @ignored_repos
|
13
|
+
@repos_paths.build
|
21
14
|
@repos = @repos_paths.map {|repo| Metaverse::Repo.new repo}
|
22
15
|
end
|
23
16
|
|
24
17
|
def status
|
25
18
|
check_dirtiness
|
26
|
-
check_consistency
|
27
19
|
end
|
28
20
|
|
29
21
|
|
30
22
|
def checkout name
|
31
|
-
|
32
|
-
{
|
33
|
-
up: -> {
|
34
|
-
puts "\n # #{repo.name}".blue
|
35
|
-
repo.checkout name
|
36
|
-
},
|
37
|
-
down: -> {
|
38
|
-
puts "\n # Rolling back in #{repo.name}".blue
|
39
|
-
repo.checkout repo.pop_previous_branch
|
40
|
-
}
|
41
|
-
}
|
42
|
-
}
|
43
|
-
|
44
|
-
if check_dirtiness and check_consistency
|
45
|
-
actions = @repos.map {|repo|
|
46
|
-
puts "\n # #{repo.name}".blue
|
47
|
-
Transacted::Action.new action_options.call(repo)
|
48
|
-
}
|
49
|
-
|
50
|
-
checkout_transaction = Transacted::Transaction.new actions
|
51
|
-
case checkout_transaction.execute
|
52
|
-
when :execution_success then puts "Checkout successful".green
|
53
|
-
when :rollback_success then raise "An error prevented checking out the system. Rolled back successfully".yellow
|
54
|
-
when :rollback_failure then raise "An error was encountered during the checkout. In addition, an error happened while trying to rollback the system. Please fix the state of your system manually.".red
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
23
|
+
@repos.each { |repo| repo.checkout name } if check_dirtiness
|
58
24
|
end
|
59
25
|
|
60
26
|
def create_state prefix, state
|
@@ -62,47 +28,24 @@ module Metaverse
|
|
62
28
|
puts "\n # #{repo.name}".blue
|
63
29
|
repo.create_state prefix, state
|
64
30
|
repo.checkout "#{prefix}/#{state}" if not prefix == "snapshot"
|
65
|
-
}
|
31
|
+
}
|
66
32
|
end
|
67
33
|
|
68
34
|
|
69
|
-
def load_state prefix, state, remote = nil
|
70
|
-
|
71
|
-
{
|
72
|
-
|
73
|
-
puts "\n # #{repo.name}".blue
|
74
|
-
repo.load_state prefix, state, remote, should_create_branch
|
75
|
-
},
|
76
|
-
down: -> {
|
77
|
-
puts "\n # Rolling back in #{repo.name}".blue
|
78
|
-
repo.checkout repo.peek_previous_branch
|
79
|
-
repo.delete_branch repo.pop_previous_branch if should_create_branch
|
80
|
-
}
|
81
|
-
}
|
35
|
+
def load_state prefix, state, remote = nil
|
36
|
+
@repos.each { |repo|
|
37
|
+
puts "\n # #{repo.name}".blue
|
38
|
+
repo.load_state prefix, state, remote
|
82
39
|
}
|
83
|
-
|
84
|
-
if check_dirtiness and check_consistency
|
85
|
-
|
86
|
-
actions = @repos.map { |repo|
|
87
|
-
Transacted::Action.new action_options.call repo
|
88
|
-
}
|
89
|
-
|
90
|
-
load_state_transaction = Transacted::Transaction.new actions
|
91
|
-
case load_state_transaction.execute
|
92
|
-
when :execution_success then puts "Loading state successful".green
|
93
|
-
when :rollback_success then raise "An error prevented loading the state of the system. Rolled back successfully".yellow
|
94
|
-
when :rollback_failure then raise "An error was encountered during the loading of the state. In addition, an error happened while trying to rollback the system. Please fix the state of your system manually.".red
|
95
|
-
end
|
96
|
-
end
|
97
40
|
end
|
98
41
|
|
99
42
|
|
100
|
-
def send_state prefix, state, remote
|
43
|
+
def send_state prefix, state, remote
|
101
44
|
@repos.each { |repo|
|
102
45
|
puts "\n # #{repo.name}".blue
|
103
46
|
is_branch = repo.current_branch.match /refs\/heads\/(.*)/
|
104
|
-
repo.send_state prefix, state, remote,
|
105
|
-
}
|
47
|
+
repo.send_state prefix, state, remote, !!is_branch
|
48
|
+
}
|
106
49
|
end
|
107
50
|
|
108
51
|
|
@@ -110,7 +53,7 @@ module Metaverse
|
|
110
53
|
@repos.each { |repo|
|
111
54
|
puts "\n # #{repo.name}".blue
|
112
55
|
repo.update remote
|
113
|
-
}
|
56
|
+
}
|
114
57
|
end
|
115
58
|
|
116
59
|
|
@@ -140,67 +83,15 @@ module Metaverse
|
|
140
83
|
dirty_repos.length == 0
|
141
84
|
end
|
142
85
|
|
143
|
-
def check_consistency
|
144
|
-
branch_name = system_state.first
|
145
|
-
inconsistent_repos = @repos.reject { |repo|
|
146
|
-
repo.current_branch == branch_name
|
147
|
-
}.map &:name
|
148
|
-
|
149
|
-
if inconsistent_repos.length == 0
|
150
|
-
puts 'The system is consistent'.green
|
151
|
-
else
|
152
|
-
puts 'The system is inconsistent. Please check the following repos :'.red , inconsistent_repos
|
153
|
-
end
|
154
|
-
inconsistent_repos.length == 0
|
155
|
-
end
|
156
|
-
|
157
86
|
def read_config path
|
158
|
-
Errors::config_not_found! if not File.exist? path
|
159
|
-
|
160
87
|
config = YAML.load File.open(path)
|
161
|
-
@repos_paths = config['repos'] || []
|
162
88
|
@origin_remote = config['remotes']['main']
|
163
89
|
@own_remote = config['remotes']['own']
|
164
90
|
@ignored_repos = config['ignore'] || []
|
165
91
|
end
|
166
92
|
|
167
|
-
def save_config path
|
168
|
-
config = {
|
169
|
-
'repos' => @repos_paths.map{ |repo| repo },
|
170
|
-
'remotes'=> {
|
171
|
-
'main' => @origin_remote,
|
172
|
-
'own' => @own_remote
|
173
|
-
},
|
174
|
-
'ignore' => @ignored_repos
|
175
|
-
}
|
176
|
-
File.open(path, 'w') {|f| f.write config.to_yaml }
|
177
|
-
end
|
178
|
-
|
179
|
-
def clear_repos
|
180
|
-
@repos_paths = []
|
181
|
-
save_config "#{@base_path}/.meta.yml"
|
182
|
-
puts "Repos cache cleared.".green
|
183
|
-
end
|
184
|
-
|
185
93
|
def pull
|
186
|
-
@repos.each { |repo|
|
187
|
-
puts "\n # #{repo.name}".blue
|
188
|
-
repo.pull @origin_remote
|
189
|
-
} if check_dirtiness and check_consistency
|
190
|
-
end
|
191
|
-
|
192
|
-
def add_remote name, base_url
|
193
|
-
@repos.each { |repo|
|
194
|
-
puts "\n # #{repo.name}".blue
|
195
|
-
repo.add_remote name, "#{base_url}/#{repo.name}"
|
196
|
-
}
|
197
|
-
end
|
198
|
-
|
199
|
-
def exec env, command
|
200
|
-
@repos.each { |repo|
|
201
|
-
puts "\n # #{repo.name}".blue
|
202
|
-
repo.exec env, command
|
203
|
-
}
|
94
|
+
@repos.each { |repo| repo.pull @origin_remote }
|
204
95
|
end
|
205
96
|
end
|
206
97
|
end
|
data/lib/metaverse/cli.rb
CHANGED
@@ -8,12 +8,6 @@ module Metaverse
|
|
8
8
|
@meta = Base.new Dir.pwd
|
9
9
|
end
|
10
10
|
|
11
|
-
desc "reset", "Empties the repos cache"
|
12
|
-
def reset
|
13
|
-
init
|
14
|
-
@meta.clear_repos
|
15
|
-
end
|
16
|
-
|
17
11
|
desc "branches", "Displays the branch in which each repo is"
|
18
12
|
def branches
|
19
13
|
init
|
@@ -31,40 +25,34 @@ module Metaverse
|
|
31
25
|
end
|
32
26
|
|
33
27
|
desc "feature [COMMAND] [FEATURE_NAME]", "Creates a new feature branch or loads a previous one"
|
34
|
-
option :branch, type: :boolean, aliases: '-b'
|
35
28
|
def feature command, name, remote = nil
|
36
29
|
init
|
37
30
|
case command
|
38
31
|
when 'new' then @meta.create_state 'feature', name
|
39
|
-
when 'load' then @meta.load_state 'feature', name, remote
|
32
|
+
when 'load' then @meta.load_state 'feature', name, remote
|
40
33
|
when 'send' then @meta.send_state 'feature', name, remote
|
41
|
-
when 'close' then @meta.send_state 'feature', name, remote, true
|
42
34
|
end
|
43
35
|
end
|
44
36
|
|
45
37
|
|
46
38
|
desc "release [COMMAND] [FEATURE_NAME]", "Creates a new release branch or loads a previous one"
|
47
|
-
option :branch, type: :boolean, aliases: '-b'
|
48
39
|
def release command, name, remote = nil
|
49
40
|
init
|
50
41
|
case command
|
51
42
|
when 'new' then @meta.create_state 'release', name
|
52
|
-
when 'load' then @meta.load_state 'release', name, remote
|
43
|
+
when 'load' then @meta.load_state 'release', name, remote
|
53
44
|
when 'send' then @meta.send_state 'release', name, remote
|
54
|
-
when 'close' then @meta.send_state 'release', name, remote, true
|
55
45
|
end
|
56
46
|
end
|
57
47
|
|
58
48
|
|
59
49
|
desc "bugfix [COMMAND] [FEATURE_NAME]", "Creates a new bugfix branch or loads a previous one"
|
60
|
-
option :branch, type: :boolean, aliases: '-b'
|
61
50
|
def bugfix command, name, remote = nil
|
62
51
|
init
|
63
52
|
case command
|
64
53
|
when 'new' then @meta.create_state 'bugfix', name
|
65
|
-
when 'load' then @meta.load_state 'bugfix', name, remote
|
54
|
+
when 'load' then @meta.load_state 'bugfix', name, remote
|
66
55
|
when 'send' then @meta.send_state 'bugfix', name, remote
|
67
|
-
when 'close' then @meta.send_state 'bugfix', name, remote, true
|
68
56
|
end
|
69
57
|
end
|
70
58
|
|
@@ -98,7 +86,6 @@ module Metaverse
|
|
98
86
|
init
|
99
87
|
case command
|
100
88
|
when 'dirtiness' then @meta.check_dirtiness
|
101
|
-
when 'consistency' then @meta.check_consistency
|
102
89
|
end
|
103
90
|
end
|
104
91
|
|
@@ -107,19 +94,5 @@ module Metaverse
|
|
107
94
|
init
|
108
95
|
@meta.pull
|
109
96
|
end
|
110
|
-
|
111
|
-
desc "remote [COMMAND]", "manages repos remotes such as adding new ones"
|
112
|
-
def remote command, name, url
|
113
|
-
init
|
114
|
-
case command
|
115
|
-
when 'add' then @meta.add_remote name, url
|
116
|
-
end
|
117
|
-
end
|
118
|
-
|
119
|
-
desc "exec [COMMAND]", "runs the specified shell command in every repo"
|
120
|
-
def exec *command
|
121
|
-
init
|
122
|
-
@meta.exec ENV, command.join(' ')
|
123
|
-
end
|
124
97
|
end
|
125
98
|
end
|
data/lib/metaverse/iterator.rb
CHANGED
data/lib/metaverse/repo.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
require '
|
2
|
-
require 'iniparse'
|
1
|
+
require 'metaverse/git'
|
3
2
|
|
4
3
|
module Metaverse
|
5
4
|
class Repo
|
@@ -9,7 +8,6 @@ module Metaverse
|
|
9
8
|
|
10
9
|
def initialize path
|
11
10
|
load path
|
12
|
-
@previous_branches = []
|
13
11
|
end
|
14
12
|
|
15
13
|
|
@@ -28,54 +26,16 @@ module Metaverse
|
|
28
26
|
File.basename @repo.workdir
|
29
27
|
end
|
30
28
|
|
31
|
-
def workdir
|
32
|
-
@repo.workdir
|
33
|
-
end
|
34
29
|
|
35
30
|
def checkout ref
|
36
|
-
|
37
|
-
is_reference = false
|
38
|
-
if Rugged::Reference.valid_name?(ref) and @repo.references[ref].nil?
|
39
|
-
raise Errors::ref_not_found ref
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
@previous_branches.push current_branch
|
44
|
-
Dir.chdir(@repo.workdir) do
|
45
|
-
`git checkout #{ref}`#TODO: find out what's going on, check out a branch
|
46
|
-
end
|
31
|
+
@repo.checkout ref
|
47
32
|
end
|
48
33
|
|
49
34
|
|
50
35
|
def current_branch
|
51
|
-
|
52
|
-
|
53
|
-
Dir.chdir(@repo.workdir) do
|
54
|
-
branch_name = `git branch | sed -n '/\* /s///p'`
|
55
|
-
#TODO Look into why the command returns an empty string in a new repo
|
56
|
-
if branch_name == ''
|
57
|
-
branch_name = 'master'
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
if branch_name.include? "detached"
|
62
|
-
match = /[A-Za-z0-9._-]+(?:\/[A-Za-z0-9._-]+)+/.match(branch_name)
|
63
|
-
if not match.nil?
|
64
|
-
return match[0]
|
65
|
-
end
|
66
|
-
return 'HEAD'
|
67
|
-
end
|
68
|
-
|
69
|
-
branch_name.strip
|
36
|
+
@repo.head.name
|
70
37
|
end
|
71
38
|
|
72
|
-
def peek_previous_branch
|
73
|
-
@previous_branches.last
|
74
|
-
end
|
75
|
-
|
76
|
-
def pop_previous_branch
|
77
|
-
@previous_branches.pop
|
78
|
-
end
|
79
39
|
|
80
40
|
def head
|
81
41
|
@repo.head
|
@@ -108,84 +68,48 @@ module Metaverse
|
|
108
68
|
end
|
109
69
|
|
110
70
|
|
111
|
-
def load_state prefix, state, remote = nil
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
# TODO: Decide what to do when a branch exists previous. Should we :
|
118
|
-
# - Replace it's ref by the saved state ? ( We lose the previous branch reference)
|
119
|
-
# - Load it as it is ( We may get an inconsistent state since the branch could point to a different commit than the state reference )
|
120
|
-
if @repo.branches[branch_name].nil?
|
121
|
-
puts "Creating branch #{branch_name} based on #{ref_name}"
|
122
|
-
@repo.create_branch branch_name, ref_name
|
123
|
-
end
|
124
|
-
return checkout branch_name
|
125
|
-
end
|
126
|
-
checkout ref_name
|
71
|
+
def load_state prefix, state, remote = nil
|
72
|
+
path_prefix = "refs/meta"
|
73
|
+
path_prefix += "/local" if remote.nil?
|
74
|
+
path_prefix += "/remotes/#{remote}" if not remote.nil?
|
75
|
+
ref_name = "/#{prefix}/#{state}"
|
76
|
+
@repo.checkout path_prefix + ref_name
|
127
77
|
end
|
128
78
|
|
129
79
|
|
130
|
-
def send_state prefix, state, remote,
|
80
|
+
def send_state prefix, state, remote, is_branch
|
131
81
|
refs = ["refs/meta/local/#{prefix}/#{state}"]
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
if branch.nil?
|
137
|
-
Errors::ref_not_found branch_name
|
138
|
-
return false
|
139
|
-
end
|
140
|
-
|
141
|
-
if develop.nil?
|
142
|
-
Errors::ref_not_found 'develop'
|
143
|
-
return false
|
82
|
+
if (not prefix == 'snapshot') and is_branch and clean_branch prefix, state
|
83
|
+
refs << "#{prefix}/#{state}"
|
84
|
+
update_ref refs[0], @repo.head
|
144
85
|
end
|
145
|
-
|
146
|
-
if (not prefix == 'snapshot') and ahead_of_develop? branch
|
147
|
-
refs << branch_name
|
148
|
-
update_ref refs[0], @repo.branches[branch_name]
|
149
|
-
end
|
150
|
-
|
151
|
-
clean_branch branch if should_clean
|
152
|
-
|
153
86
|
Dir.chdir(@repo.workdir) do
|
154
87
|
`git push #{remote} #{refs.join(' ')}`
|
155
88
|
end
|
156
89
|
end
|
157
90
|
|
158
91
|
|
159
|
-
def clean_branch
|
92
|
+
def clean_branch prefix, state
|
93
|
+
target_branch = @repo.branches["#{prefix}/#{state}"]
|
160
94
|
|
161
|
-
changed =
|
95
|
+
changed = has_changes? target_branch, @repo.branches['develop']
|
162
96
|
if not changed
|
163
|
-
checkout 'develop'
|
164
|
-
@repo.branches.delete
|
97
|
+
@repo.checkout 'develop'
|
98
|
+
@repo.branches.delete target_branch
|
165
99
|
end
|
166
100
|
changed
|
167
101
|
end
|
168
102
|
|
169
|
-
def delete_branch branch
|
170
|
-
if not @repo.branches[branch].nil?
|
171
|
-
@repo.branches.delete branch
|
172
|
-
end
|
173
|
-
end
|
174
|
-
|
175
103
|
def dirty?
|
176
104
|
is_dirty = false
|
177
105
|
@repo.status { |file, data|
|
178
|
-
|
179
|
-
is_dirty = true
|
106
|
+
is_dirty = !(data.include? :ignored) or is_dirty
|
180
107
|
}
|
181
108
|
is_dirty
|
182
109
|
end
|
183
110
|
|
184
111
|
|
185
112
|
def update remote = nil
|
186
|
-
if not remote.nil? and @repo.remotes[remote].nil?
|
187
|
-
return Errors::remote_not_found remote
|
188
|
-
end
|
189
113
|
Dir.chdir(@repo.workdir) do
|
190
114
|
`git remote update #{remote}`
|
191
115
|
end
|
@@ -193,11 +117,10 @@ module Metaverse
|
|
193
117
|
|
194
118
|
|
195
119
|
def add_option_to_remote remote, value, key
|
196
|
-
|
197
|
-
cfg = IniParse.parse(File.read(config_path))
|
120
|
+
cfg = IniParse.parse(File.read("#{@repo.path}/config"))
|
198
121
|
if not [*cfg["remote \"#{remote}\""][key]].include? value
|
199
122
|
cfg["remote \"#{remote}\""][key] = [*cfg["remote \"#{remote}\""][key], value]
|
200
|
-
cfg.save
|
123
|
+
cfg.save "#{@path}/config"
|
201
124
|
end
|
202
125
|
end
|
203
126
|
|
@@ -207,28 +130,8 @@ module Metaverse
|
|
207
130
|
end
|
208
131
|
|
209
132
|
|
210
|
-
def ahead_of_develop? branch
|
211
|
-
has_changes? branch, @repo.branches['develop']
|
212
|
-
end
|
213
|
-
|
214
133
|
def pull remote
|
215
|
-
|
216
|
-
return Errors::remote_not_found remote
|
217
|
-
end
|
218
|
-
Dir.chdir(@repo.workdir) do
|
219
|
-
`git pull #{remote} #{current_branch}`
|
220
|
-
end
|
221
|
-
end
|
222
|
-
|
223
|
-
def add_remote name, url
|
224
|
-
return Errors::remote_exists name if not @repo.remotes[name].nil?
|
225
|
-
@repo.remotes.create name, url
|
226
|
-
end
|
227
|
-
|
228
|
-
def exec env, command
|
229
|
-
Dir.chdir(@repo.workdir) do
|
230
|
-
system env, command
|
231
|
-
end
|
134
|
+
`git pull #{remote}`
|
232
135
|
end
|
233
136
|
end
|
234
137
|
end
|
data/lib/metaverse/version.rb
CHANGED
data/metaverse.gemspec
CHANGED
@@ -29,6 +29,4 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.add_runtime_dependency "thor", "~> 0.19"
|
30
30
|
spec.add_runtime_dependency "colorize", "~> 0.7"
|
31
31
|
spec.add_runtime_dependency "rugged", "~> 0.21"
|
32
|
-
spec.add_runtime_dependency "iniparse", "~> 1.4.0"
|
33
|
-
spec.add_runtime_dependency "transacted", "~> 0.1"
|
34
32
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metaverse
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Omar Kamali
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -94,34 +94,6 @@ dependencies:
|
|
94
94
|
- - ~>
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0.21'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: iniparse
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - ~>
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: 1.4.0
|
104
|
-
type: :runtime
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - ~>
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: 1.4.0
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: transacted
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - ~>
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '0.1'
|
118
|
-
type: :runtime
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - ~>
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '0.1'
|
125
97
|
description:
|
126
98
|
email:
|
127
99
|
- okamali@productivemobile.com
|
@@ -143,7 +115,6 @@ files:
|
|
143
115
|
- lib/metaverse.rb
|
144
116
|
- lib/metaverse/base.rb
|
145
117
|
- lib/metaverse/cli.rb
|
146
|
-
- lib/metaverse/errors.rb
|
147
118
|
- lib/metaverse/iterator.rb
|
148
119
|
- lib/metaverse/repo.rb
|
149
120
|
- lib/metaverse/version.rb
|
@@ -165,9 +136,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
165
136
|
version: '0'
|
166
137
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
167
138
|
requirements:
|
168
|
-
- - '
|
139
|
+
- - '>'
|
169
140
|
- !ruby/object:Gem::Version
|
170
|
-
version:
|
141
|
+
version: 1.3.1
|
171
142
|
requirements: []
|
172
143
|
rubyforge_project:
|
173
144
|
rubygems_version: 2.0.14
|
data/lib/metaverse/errors.rb
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
require 'colorize'
|
2
|
-
|
3
|
-
module Metaverse
|
4
|
-
class Errors
|
5
|
-
def self.config_not_found!
|
6
|
-
abort ".meta.yml file was not found in the current working directory. Exiting ...".red
|
7
|
-
end
|
8
|
-
|
9
|
-
def self.ref_not_found ref
|
10
|
-
return Exception.new "Reference '#{ref}' does not exist.".red
|
11
|
-
end
|
12
|
-
|
13
|
-
def self.remote_not_found remote
|
14
|
-
puts "Remote '#{remote}' does not exist. Skipping ...".red
|
15
|
-
end
|
16
|
-
|
17
|
-
def self.remote_exists remote
|
18
|
-
puts "Remote '#{remote}' exists already. Skipping ...".red
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|