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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 884e798274a3ebf4536ea1c9b1d5812710af9cea
4
- data.tar.gz: c2371203d1841f8f7e21e8723f7a913aeee652e9
3
+ metadata.gz: fab4e71eb8a9030b260c326ed00356c00599b188
4
+ data.tar.gz: 6a49f5adc720cbbb756b8d17997ccc68b069549c
5
5
  SHA512:
6
- metadata.gz: 2aac34d87f08108cf7d80de4082184c911d107e8c8dd826b1e702fc7cbf29a3817dfea303deabdcfa40d97ff3f37eaab0a464eb61bf9ef30e03a6d98880b9b3d
7
- data.tar.gz: dbd0f05aae043d34cee770cf6a1d5444db7230081120a221e3856edf2060428ab7338f7b7cdf0ba8efe48c27d0f730803a36b7503a72bc68a31efe7f7bc6c93c
6
+ metadata.gz: e9060ba684a240165b48c4ee1ed20d7a92a929f517d951a3283dc845e966b9967128904a423de094d3f924d35e481c091470e1c37ea9714ab8a1ba21959f62c1
7
+ data.tar.gz: 3bff01a6e2f85336c3711cef25049bfcb3df181007c020bfd44e3dda9add0d5ea66fd39bb315b9d2e04ea82b3e061a53b4b884e51375a725cae0a5d73b60fe0d
data/History.rdoc CHANGED
@@ -1,3 +1,6 @@
1
+ === 0.5.0 / 27-10-2016
2
+ * helpers automacally included when a new program is created
3
+
1
4
  === 0.4.0 / 19-10-2016
2
5
  * option to set exec_path and copy newly created programs
3
6
 
@@ -1,6 +1,6 @@
1
1
  # REF: 0
2
2
  require 'yaml'
3
- require 'simple_commander/helpers/io'
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 = "#{s_path}/lib"
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,3 +1,3 @@
1
1
  ---
2
- :path: "/Users/marcell/Documents/github/sc_scripts"
2
+ :path: "/Users/marcell/Documents/github/simple_commander/spec/mock"
3
3
  :exec_path: "/Users/marcell/bin"
@@ -1 +1,2 @@
1
- require 'simple_commander/helpers/io'
1
+ require File.dirname(__FILE__) + '/../../helpers/io_helper'
2
+ require File.dirname(__FILE__) + '/../../helpers/http_helper'
@@ -1,3 +1,3 @@
1
1
  module SimpleCommander
2
- VERSION = '0.4.0'
2
+ VERSION = '0.5.0'
3
3
  end
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
- update new version
3
- test the new version on windows
4
- create a helpers folder inside the program
5
- make overwrite the default helpers easy
6
- put command in the path of the new program
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
- make writing tests easy
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.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-19 00:00:00.000000000 Z
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
@@ -1,7 +0,0 @@
1
- require 'rubygems'
2
- require 'simple_commander/import'
3
-
4
- program :name, 'test'
5
- program :version, Test::VERSION
6
- program :description, 'test utility program.'
7
- helpers 'IO'
@@ -1 +0,0 @@
1
- require 'test/version'
@@ -1,3 +0,0 @@
1
- module Test
2
- VERSION = '0.0.1'
3
- end