shelldon 0.0.1 → 0.0.7

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.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +11 -0
  3. data/.rubocop.yml +60 -0
  4. data/Gemfile +0 -5
  5. data/README.md +0 -1
  6. data/lib/auto_complete.rb +34 -0
  7. data/lib/command/command.rb +63 -11
  8. data/lib/command/command_list.rb +16 -8
  9. data/lib/command/script.rb +33 -0
  10. data/lib/config/config.rb +13 -4
  11. data/lib/config/config_factory.rb +4 -0
  12. data/lib/config/param.rb +17 -11
  13. data/lib/config/param/boolean_param.rb +1 -1
  14. data/lib/config/param_factory.rb +6 -1
  15. data/lib/dsl.rb +17 -0
  16. data/lib/{Exceptions → exceptions}/error_factory.rb +10 -0
  17. data/lib/exceptions/exceptions.rb +60 -0
  18. data/lib/file_management/config_file_manager.rb +3 -7
  19. data/lib/file_management/history_file.rb +0 -2
  20. data/lib/file_management/yaml_manager.rb +10 -1
  21. data/lib/helpers/confirmation.rb +20 -0
  22. data/lib/helpers/timer.rb +5 -0
  23. data/lib/opts/opt_factory.rb +4 -3
  24. data/lib/opts/opts.rb +1 -1
  25. data/lib/shell/shell.rb +82 -19
  26. data/lib/shell/shell_factory.rb +87 -14
  27. data/lib/shell/shell_index.rb +11 -1
  28. data/lib/shelldon.rb +8 -3
  29. data/lib/shelldon/version.rb +1 -1
  30. data/shelldon.gemspec +15 -8
  31. data/test_shell/Gemfile +1 -2
  32. data/test_shell/Gemfile.lock +7 -6
  33. data/test_shell/dependency_test/Gemfile +2 -0
  34. data/test_shell/dependency_test/Gemfile.lock +21 -0
  35. data/test_shell/dependency_test/dependency_test.rb +20 -0
  36. data/test_shell/dependency_test/dt_commands.rb +66 -0
  37. data/test_shell/dependency_test/dt_config.rb +31 -0
  38. data/test_shell/dependency_test/dt_opts.rb +11 -0
  39. data/test_shell/dependency_test/dt_runner.rb +11 -0
  40. data/test_shell/simple_shell.rb +6 -6
  41. data/test_shell/test_shell.rb +46 -3
  42. data/test_shell/useful_commands.rb +1 -1
  43. metadata +80 -41
  44. data/Gemfile.lock +0 -43
@@ -1,16 +1,47 @@
1
1
  require 'shelldon'
2
2
  require 'pp'
3
- Shelldon.shell do
4
- opts { opt '--debug', '-d', :boolean }
3
+ require 'auto_complete'
4
+ Shelldon.shell :test do
5
+ opts do
6
+ opt '--debug', '-d', :boolean
7
+ opt '--help', '-h', :boolean
8
+ end
9
+
10
+ on_opt 'help' do
11
+ puts "Here's some help!"
12
+ exit 0
13
+ end
14
+
15
+ scripts '~/test/test-scripts'
16
+
17
+ command :script do
18
+ action { '' }
19
+ scripts '~/test/scripts2'
20
+ end
5
21
 
6
22
  config do
7
23
  config_file '.shelldon_config'
24
+
8
25
  param :debug_mode do
9
26
  type :boolean
10
27
  default false
11
28
  opt 'd'
12
29
  end
13
30
 
31
+ param :'-o' do
32
+ type :string
33
+ default 'emacs'
34
+ adjust { |s| s.to_s.downcase.strip.gsub('vim', 'vi') }
35
+ validate do |s|
36
+ return false unless s == 'emacs' || s == 'vi'
37
+ if s == 'emacs'
38
+ Readline.emacs_editing_mode; true
39
+ else
40
+ Readline.vi_editing_mode; true
41
+ end
42
+ end
43
+ end
44
+
14
45
  param :value do
15
46
  type :string
16
47
  default 'This is the default value!'
@@ -28,8 +59,18 @@ Shelldon.shell do
28
59
 
29
60
  command :blah do
30
61
  action { puts config[:value] }
62
+ autocomplete %w(dingus dugbus)
63
+
64
+ subcommand :swiggity do
65
+ action { puts 'beh' }
66
+ end
67
+
31
68
  subcommand :swag do
32
69
  action { puts 'SWIGGITY SWAG!!!!' }
70
+
71
+ subcommand :foobar do
72
+ action { puts 'BUNGIS' }
73
+ end
33
74
  end
34
75
  end
35
76
 
@@ -76,7 +117,9 @@ Shelldon.shell do
76
117
 
77
118
  errors do
78
119
  accept StandardError
79
- accept(Interrupt) { puts '^C' }
120
+ # accept(Interrupt) { puts '^C' }
80
121
  end
81
122
  end
82
123
  end
124
+
125
+ Shelldon[:test].run
@@ -8,4 +8,4 @@ Shelldon.shell do
8
8
  config[tokens[0].to_sym].toggle
9
9
  end
10
10
  end
11
- end
11
+ end
metadata CHANGED
@@ -1,15 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shelldon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wesley Boynton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-13 00:00:00.000000000 Z
11
+ date: 2016-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: getopt
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 1.4.2
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 1.4.2
27
+ - !ruby/object:Gem::Dependency
28
+ name: fuzzy_match
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
13
41
  - !ruby/object:Gem::Dependency
14
42
  name: bundler
15
43
  requirement: !ruby/object:Gem::Requirement
@@ -62,46 +90,57 @@ executables:
62
90
  extensions: []
63
91
  extra_rdoc_files: []
64
92
  files:
65
- - "./Gemfile"
66
- - "./Gemfile.lock"
67
- - "./LICENSE.txt"
68
- - "./README.md"
69
- - "./Rakefile"
70
- - "./bin/shelldon"
71
- - "./build_and_install.sh"
72
- - "./lib/Exceptions/error_factory.rb"
73
- - "./lib/cli.rb"
74
- - "./lib/command/command.rb"
75
- - "./lib/command/command_list.rb"
76
- - "./lib/config/config.rb"
77
- - "./lib/config/config_factory.rb"
78
- - "./lib/config/param.rb"
79
- - "./lib/config/param/boolean_param.rb"
80
- - "./lib/config/param/number_param.rb"
81
- - "./lib/config/param/string_param.rb"
82
- - "./lib/config/param_factory.rb"
83
- - "./lib/defaults/commands.rb"
84
- - "./lib/dsl.rb"
85
- - "./lib/file_management/config_file_manager.rb"
86
- - "./lib/file_management/file_manager.rb"
87
- - "./lib/file_management/history_file.rb"
88
- - "./lib/file_management/yaml_manager.rb"
89
- - "./lib/helpers/timer.rb"
90
- - "./lib/opts/opt_factory.rb"
91
- - "./lib/opts/opts.rb"
92
- - "./lib/shell/shell.rb"
93
- - "./lib/shell/shell_factory.rb"
94
- - "./lib/shell/shell_index.rb"
95
- - "./lib/shelldon.rb"
96
- - "./lib/shelldon/version.rb"
97
- - "./shelldon.gemspec"
98
- - "./test_shell/Gemfile"
99
- - "./test_shell/Gemfile.lock"
100
- - "./test_shell/run.sh"
101
- - "./test_shell/simple_shell.rb"
102
- - "./test_shell/test_shell.rb"
103
- - "./test_shell/useful_commands.rb"
93
+ - ".gitignore"
94
+ - ".rubocop.yml"
95
+ - Gemfile
96
+ - LICENSE.txt
97
+ - README.md
98
+ - Rakefile
104
99
  - bin/shelldon
100
+ - build_and_install.sh
101
+ - lib/auto_complete.rb
102
+ - lib/cli.rb
103
+ - lib/command/command.rb
104
+ - lib/command/command_list.rb
105
+ - lib/command/script.rb
106
+ - lib/config/config.rb
107
+ - lib/config/config_factory.rb
108
+ - lib/config/param.rb
109
+ - lib/config/param/boolean_param.rb
110
+ - lib/config/param/number_param.rb
111
+ - lib/config/param/string_param.rb
112
+ - lib/config/param_factory.rb
113
+ - lib/defaults/commands.rb
114
+ - lib/dsl.rb
115
+ - lib/exceptions/error_factory.rb
116
+ - lib/exceptions/exceptions.rb
117
+ - lib/file_management/config_file_manager.rb
118
+ - lib/file_management/file_manager.rb
119
+ - lib/file_management/history_file.rb
120
+ - lib/file_management/yaml_manager.rb
121
+ - lib/helpers/confirmation.rb
122
+ - lib/helpers/timer.rb
123
+ - lib/opts/opt_factory.rb
124
+ - lib/opts/opts.rb
125
+ - lib/shell/shell.rb
126
+ - lib/shell/shell_factory.rb
127
+ - lib/shell/shell_index.rb
128
+ - lib/shelldon.rb
129
+ - lib/shelldon/version.rb
130
+ - shelldon.gemspec
131
+ - test_shell/Gemfile
132
+ - test_shell/Gemfile.lock
133
+ - test_shell/dependency_test/Gemfile
134
+ - test_shell/dependency_test/Gemfile.lock
135
+ - test_shell/dependency_test/dependency_test.rb
136
+ - test_shell/dependency_test/dt_commands.rb
137
+ - test_shell/dependency_test/dt_config.rb
138
+ - test_shell/dependency_test/dt_opts.rb
139
+ - test_shell/dependency_test/dt_runner.rb
140
+ - test_shell/run.sh
141
+ - test_shell/simple_shell.rb
142
+ - test_shell/test_shell.rb
143
+ - test_shell/useful_commands.rb
105
144
  homepage: https://github.com/wwboynton/shelldon
106
145
  licenses:
107
146
  - MIT
@@ -1,43 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- shelldon (0.0.1)
5
- rb-readline
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- ast (2.1.0)
11
- astrolabe (1.3.1)
12
- parser (~> 2.2)
13
- byebug (8.2.1)
14
- getopt (1.4.2)
15
- parser (2.2.2.6)
16
- ast (>= 1.1, < 3.0)
17
- powerpack (0.1.1)
18
- rainbow (2.0.0)
19
- rake (10.4.2)
20
- rb-readline (0.5.3)
21
- rubocop (0.33.0)
22
- astrolabe (~> 1.3)
23
- parser (>= 2.2.2.5, < 3.0)
24
- powerpack (~> 0.1)
25
- rainbow (>= 1.99.1, < 3.0)
26
- ruby-progressbar (~> 1.4)
27
- ruby-progressbar (1.7.5)
28
- terminal-table (1.5.2)
29
-
30
- PLATFORMS
31
- ruby
32
-
33
- DEPENDENCIES
34
- bundler (~> 1.10)
35
- byebug
36
- getopt
37
- rake (~> 10.0)
38
- rubocop
39
- shelldon!
40
- terminal-table
41
-
42
- BUNDLED WITH
43
- 1.10.6