simple_commander 0.4.0 → 0.5.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.
- checksums.yaml +4 -4
- data/History.rdoc +3 -0
- data/{lib/simple_commander/helpers/io.rb → helpers/io_helper.rb} +0 -0
- data/lib/simple_commander/cli.rb +8 -2
- data/lib/simple_commander/config.yml +1 -1
- data/lib/simple_commander/helpers.rb +2 -1
- data/lib/simple_commander/version.rb +1 -1
- data/spec/cli_spec.rb +6 -0
- data/templates/bin.erb +6 -0
- data/todo.yml +18 -7
- metadata +3 -6
- data/spec/mock/test/bin/test +0 -7
- data/spec/mock/test/lib/test.rb +0 -1
- data/spec/mock/test/lib/test/version.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fab4e71eb8a9030b260c326ed00356c00599b188
|
4
|
+
data.tar.gz: 6a49f5adc720cbbb756b8d17997ccc68b069549c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9060ba684a240165b48c4ee1ed20d7a92a929f517d951a3283dc845e966b9967128904a423de094d3f924d35e481c091470e1c37ea9714ab8a1ba21959f62c1
|
7
|
+
data.tar.gz: 3bff01a6e2f85336c3711cef25049bfcb3df181007c020bfd44e3dda9add0d5ea66fd39bb315b9d2e04ea82b3e061a53b4b884e51375a725cae0a5d73b60fe0d
|
data/History.rdoc
CHANGED
File without changes
|
data/lib/simple_commander/cli.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# REF: 0
|
2
2
|
require 'yaml'
|
3
|
-
require '
|
3
|
+
require File.dirname(__FILE__) + '/../../helpers/io_helper'
|
4
4
|
require 'fileutils'
|
5
5
|
require 'byebug'
|
6
6
|
|
@@ -10,6 +10,8 @@ module SimpleCommander
|
|
10
10
|
DEFAULT_PATH = "#{File.dirname(__FILE__)}/config.yml"
|
11
11
|
TEMPLATE_PATH = File.expand_path "#{File.dirname(__FILE__)}" +
|
12
12
|
'/../../templates'
|
13
|
+
HELPERS_PATH = File.expand_path "#{File.dirname(__FILE__)}" +
|
14
|
+
'/../../helpers'
|
13
15
|
attr_accessor :config_file
|
14
16
|
|
15
17
|
class UndefinedSCPath < StandardError
|
@@ -59,11 +61,13 @@ simple_commander init
|
|
59
61
|
s_path = "#{sc_path}/#{args[0]}"
|
60
62
|
fail InvalidProgram, "program #{args[0]} already exists!", caller if File.directory?(s_path)
|
61
63
|
@program_name = args[0]
|
62
|
-
@lib_path
|
64
|
+
@lib_path = "#{s_path}/lib"
|
65
|
+
@helper_path = "#{s_path}/helpers"
|
63
66
|
mkdir s_path
|
64
67
|
mkdir "#{s_path}/bin"
|
65
68
|
mkdir "#{s_path}/spec"
|
66
69
|
mkdir "#{s_path}/lib"
|
70
|
+
mkdir "#{s_path}/helpers"
|
67
71
|
mkdir "#{s_path}/lib/#{@program_name}"
|
68
72
|
template "#{TEMPLATE_PATH}/lib.erb",
|
69
73
|
"#{s_path}/lib/#{@program_name}.rb"
|
@@ -75,6 +79,8 @@ simple_commander init
|
|
75
79
|
"#{s_path}/bin/#{@program_name}"
|
76
80
|
FileUtils.chmod "+x", "#{s_path}/bin/#{@program_name}"
|
77
81
|
copy "#{s_path}/bin/#{@program_name}", exec_path if exec_path
|
82
|
+
copy "#{HELPERS_PATH}/io_helper.rb", "#{s_path}/helpers/io_helper.rb"
|
83
|
+
copy "#{HELPERS_PATH}/http_helper.rb", "#{s_path}/helpers/http_helper.rb"
|
78
84
|
end
|
79
85
|
|
80
86
|
##
|
@@ -1 +1,2 @@
|
|
1
|
-
require '
|
1
|
+
require File.dirname(__FILE__) + '/../../helpers/io_helper'
|
2
|
+
require File.dirname(__FILE__) + '/../../helpers/http_helper'
|
data/spec/cli_spec.rb
CHANGED
@@ -14,6 +14,12 @@ describe SimpleCommander::CLI do
|
|
14
14
|
if(File.file?(CONFIG_FILE))
|
15
15
|
FileUtils.rm(CONFIG_FILE)
|
16
16
|
end
|
17
|
+
cli_config = File.dirname(__FILE__) +
|
18
|
+
'/../lib/simple_commander/config.yml'
|
19
|
+
yml = YAML.load_file(cli_config)
|
20
|
+
if(File.file?("#{yml[:exec_path]}/ex_program"))
|
21
|
+
FileUtils.rm("#{yml[:exec_path]}/ex_program")
|
22
|
+
end
|
17
23
|
end
|
18
24
|
|
19
25
|
describe '#init' do
|
data/templates/bin.erb
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
$LOAD_PATH.unshift "<%= @lib_path %>"
|
3
|
+
$LOAD_PATH.unshift "<%= @helper_path %>"
|
3
4
|
require 'rubygems'
|
4
5
|
require 'simple_commander/import'
|
6
|
+
require 'simple_commander/import'
|
7
|
+
require 'io_helper'
|
8
|
+
require 'http_helper'
|
9
|
+
|
10
|
+
|
5
11
|
require '<%= @program_name %>'
|
data/todo.yml
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
cli:
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
make
|
6
|
-
|
7
|
-
make the newly created command work property
|
2
|
+
release a new version
|
3
|
+
create the ember-generate program with the new version
|
4
|
+
set up a default templated path for newly created programs
|
5
|
+
make writing tests easy
|
6
|
+
change docs to tell to require on the bin file newly created helpers
|
8
7
|
realease a new version and test its functionalities
|
9
8
|
identify if the name of the program is permited
|
10
|
-
|
9
|
+
test the new version on windows
|
10
|
+
|
11
|
+
release:
|
12
|
+
march 2017
|
11
13
|
|
12
14
|
create alis methods for cp etc ...
|
13
15
|
create scommader cli which transform the script in an directory with helpers,
|
@@ -27,6 +29,15 @@ learn about the implementation of the commander progress bar
|
|
27
29
|
figuring out the progress bar
|
28
30
|
|
29
31
|
done:
|
32
|
+
make the newly created command work property
|
33
|
+
put command in the path of the new program
|
34
|
+
make overwrite the default helpers easy
|
35
|
+
import helpers to the default bin program
|
36
|
+
copy the default helpers to the helpers folder of the program
|
37
|
+
create a helpers folder inside the program
|
38
|
+
write documentation for add a exec_path
|
39
|
+
update new version
|
40
|
+
write docummentation for show config
|
30
41
|
create command to set exec_path
|
31
42
|
create init cli command that creates a folder for the scripts
|
32
43
|
verify if the file exists before calling show config
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_commander
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcell Monteiro Cruz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: highline
|
@@ -107,6 +107,7 @@ files:
|
|
107
107
|
- gem.fish
|
108
108
|
- helper.rb
|
109
109
|
- helpers/http_helper.rb
|
110
|
+
- helpers/io_helper.rb
|
110
111
|
- ideal_spec.rb
|
111
112
|
- lib/simple_commander.rb
|
112
113
|
- lib/simple_commander/blank.rb
|
@@ -127,7 +128,6 @@ files:
|
|
127
128
|
- lib/simple_commander/help_formatters/terminal_compact/command_help.erb
|
128
129
|
- lib/simple_commander/help_formatters/terminal_compact/help.erb
|
129
130
|
- lib/simple_commander/helpers.rb
|
130
|
-
- lib/simple_commander/helpers/io.rb
|
131
131
|
- lib/simple_commander/import.rb
|
132
132
|
- lib/simple_commander/methods.rb
|
133
133
|
- lib/simple_commander/platform.rb
|
@@ -145,9 +145,6 @@ files:
|
|
145
145
|
- spec/help_formatters/terminal_spec.rb
|
146
146
|
- spec/methods_spec.rb
|
147
147
|
- spec/mock/config_without_path.yml
|
148
|
-
- spec/mock/test/bin/test
|
149
|
-
- spec/mock/test/lib/test.rb
|
150
|
-
- spec/mock/test/lib/test/version.rb
|
151
148
|
- spec/runner_spec.rb
|
152
149
|
- spec/spec_helper.rb
|
153
150
|
- spec/ui_spec.rb
|
data/spec/mock/test/bin/test
DELETED
data/spec/mock/test/lib/test.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
require 'test/version'
|