ora-cli 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 507b9b589105165384636b713d9d0c3ce178d068
4
- data.tar.gz: d9cf76f68eada80d4a11421fd87d95ba6352c9ca
3
+ metadata.gz: dce123c7d6166cefd6244bc774b76e67aa4d991d
4
+ data.tar.gz: 0e6dcfc4ee6ae9ea9e82d6b06e150515081482f2
5
5
  SHA512:
6
- metadata.gz: bc80ddd7872fe0988a2ce5434a3df92a26835595002923b0c6ce5504b35b70ce1c9d3f97d7774b0f6246a15a8e8b7a54dae71e2fa0199ba5921ac2ba5e307f7f
7
- data.tar.gz: 8532c9b269030f683cb80eb8a5461949a950e274be798f7e774c499048db593f3509a1b3f00e6094fff273bf64b090a8c42e3dc30cd9e07bca7d152fa906b1c2
6
+ metadata.gz: 016b3f677539db5b50ffb5f9b096b423b12236b65c0ce6138ccb61b812dcfe183284ad46484d7e4263520874777e0f05c534206471b01c0e7abe221f8587e749
7
+ data.tar.gz: 4291759dd73cc05c59d5fa3e45958eb96a6d4498ae584fe0e836b7aafa334d46d9cf8d895859ece5a6c5b980dbdfa4353a812957a32207175698180659ef0f18
data/README.md CHANGED
@@ -44,15 +44,6 @@ Useful when we need a second develop branch.
44
44
 
45
45
  > push_to_master will still push from develop to master.
46
46
 
47
- ## Error handling
48
-
49
- $ ora
50
-
51
- When a task is failed, you can resolve the issue and run `ora` again to continue.
52
- Ora-cli uses a file `~/.ora_continue` to save the state when a task is failed.
53
-
54
- > To continue a failed task using custom develop branch, you need to type the custom branch name as an argument.
55
-
56
47
  ## Contributing
57
48
 
58
49
  Bug reports and pull requests are welcome on GitHub at https://github.com/ducktyper/ora-cli.
data/lib/ora/cli/task.rb CHANGED
@@ -9,7 +9,6 @@ module Ora::Cli
9
9
  attr_reader :branch, :stdin, :print, :develop_branch
10
10
 
11
11
  DEFAULT_DEVELOP_BRANCH = 'develop'
12
- CONTINUE_FILE = '~/.ora_continue'
13
12
 
14
13
  def initialize(from, inputs: [], print: Print.new, develop_branch: nil)
15
14
  @from = from
@@ -27,29 +26,6 @@ module Ora::Cli
27
26
  @print.red("Precondition not met!\n#{e.message}")
28
27
  end
29
28
 
30
- def continue(info)
31
- @print.green("Continue task - #{info['task']}\n")
32
- set_variables(info['variables'])
33
- @bash.run info['commands']
34
- save_on_fail
35
- File.delete(File.expand_path(CONTINUE_FILE)) if @bash.success?
36
- end
37
-
38
- def variables
39
- instance_variables.inject({}) do |hash, attribute|
40
- value = instance_variable_get(attribute)
41
- if value.to_s.start_with? '#<'
42
- hash
43
- else
44
- hash.merge!(attribute.to_s.sub('@', '') => value)
45
- end
46
- end
47
- end
48
-
49
- def set_variables data
50
- data.each { |k, v| instance_variable_set("@#{k}", v) }
51
- end
52
-
53
29
  def commands
54
30
  raise PreconditionError, "Override this method in subclass."
55
31
  end
@@ -108,12 +84,7 @@ module Ora::Cli
108
84
  def save_on_fail
109
85
  return if @bash.success?
110
86
 
111
- text = JSON.generate(
112
- 'task' => underscore(self.class.name.split(':').last),
113
- 'variables' => variables,
114
- 'commands' => @bash.unprocessed_commands.join("\n")
115
- )
116
- File.write(File.expand_path(CONTINUE_FILE), text)
87
+ @print.red("Failed commands:\n#{@bash.unprocessed_commands.join("\n")}")
117
88
  end
118
89
 
119
90
  # File activesupport/lib/active_support/inflector/methods.rb
@@ -1,5 +1,5 @@
1
1
  module Ora
2
2
  module Cli
3
- VERSION = "0.2.5"
3
+ VERSION = "0.2.6"
4
4
  end
5
5
  end
data/lib/ora/cli.rb CHANGED
@@ -9,20 +9,6 @@ module Ora
9
9
  project_path = `pwd`.strip
10
10
  remove_ext = "sed 's/\.[^.]*$//'"
11
11
 
12
- unless `cat #{Task::CONTINUE_FILE}`.empty?
13
- continue = JSON.parse(File.read(File.expand_path(Task::CONTINUE_FILE)))
14
-
15
- task = continue['task']
16
- require "ora/cli/tasks/#{task}"
17
-
18
- class_name = task.split('_').map(&:capitalize).join
19
- Object.const_get("Ora::Cli::#{class_name}").
20
- new(project_path, develop_branch: custom_develop_branch).
21
- continue(continue)
22
-
23
- return
24
- end
25
-
26
12
  task = Bash.new(project_path).select("ls #{Path.tasks} | #{remove_ext}")
27
13
 
28
14
  require "ora/cli/tasks/#{task}"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ora-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ducksan Cho
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-28 00:00:00.000000000 Z
11
+ date: 2017-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -109,9 +109,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
109
  version: '0'
110
110
  requirements: []
111
111
  rubyforge_project:
112
- rubygems_version: 2.2.2
112
+ rubygems_version: 2.6.12
113
113
  signing_key:
114
114
  specification_version: 4
115
115
  summary: ORA CLI
116
116
  test_files: []
117
- has_rdoc: