gli 2.11.0 → 2.20.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +5 -5
  2. data/.circleci/config.yml +28 -0
  3. data/.gitignore +3 -3
  4. data/.tool-versions +1 -0
  5. data/Gemfile +0 -2
  6. data/README.rdoc +29 -19
  7. data/Rakefile +15 -37
  8. data/bin/ci +29 -0
  9. data/bin/gli +24 -54
  10. data/bin/rake +29 -0
  11. data/bin/setup +5 -0
  12. data/exe/gli +68 -0
  13. data/gli.gemspec +20 -24
  14. data/gli.rdoc +9 -9
  15. data/lib/gli/app.rb +31 -8
  16. data/lib/gli/app_support.rb +15 -3
  17. data/lib/gli/command.rb +24 -2
  18. data/lib/gli/command_finder.rb +42 -25
  19. data/lib/gli/command_support.rb +7 -6
  20. data/lib/gli/commands/doc.rb +9 -3
  21. data/lib/gli/commands/help.rb +2 -1
  22. data/lib/gli/commands/help_modules/arg_name_formatter.rb +2 -2
  23. data/lib/gli/commands/help_modules/command_help_format.rb +19 -1
  24. data/lib/gli/commands/help_modules/full_synopsis_formatter.rb +3 -2
  25. data/lib/gli/commands/help_modules/global_help_format.rb +1 -1
  26. data/lib/gli/commands/help_modules/options_formatter.rb +4 -6
  27. data/lib/gli/commands/initconfig.rb +3 -6
  28. data/lib/gli/commands/rdoc_document_listener.rb +2 -1
  29. data/lib/gli/commands/scaffold.rb +71 -142
  30. data/lib/gli/dsl.rb +2 -1
  31. data/lib/gli/flag.rb +23 -2
  32. data/lib/gli/gli_option_parser.rb +66 -15
  33. data/lib/gli/option_parser_factory.rb +9 -2
  34. data/lib/gli/options.rb +2 -2
  35. data/lib/gli/switch.rb +4 -0
  36. data/lib/gli/terminal.rb +6 -2
  37. data/lib/gli/version.rb +1 -1
  38. data/lib/gli.rb +1 -0
  39. data/object-model.dot +29 -0
  40. data/object-model.png +0 -0
  41. data/test/apps/todo/Gemfile +1 -1
  42. data/test/apps/todo/bin/todo +12 -6
  43. data/test/apps/todo/lib/todo/commands/create.rb +42 -41
  44. data/test/apps/todo/lib/todo/commands/list.rb +48 -36
  45. data/test/apps/todo/lib/todo/commands/ls.rb +25 -24
  46. data/test/apps/todo/lib/todo/commands/make.rb +42 -39
  47. data/test/apps/todo/todo.gemspec +1 -2
  48. data/test/apps/todo_legacy/todo.gemspec +1 -2
  49. data/test/apps/todo_plugins/commands/third.rb +2 -0
  50. data/test/integration/gli_cli_test.rb +69 -0
  51. data/test/integration/gli_powered_app_test.rb +52 -0
  52. data/test/integration/scaffold_test.rb +30 -0
  53. data/test/integration/test_helper.rb +52 -0
  54. data/test/unit/command_finder_test.rb +54 -0
  55. data/test/{tc_command.rb → unit/command_test.rb} +20 -7
  56. data/test/unit/compound_command_test.rb +17 -0
  57. data/test/{tc_doc.rb → unit/doc_test.rb} +38 -51
  58. data/test/{tc_flag.rb → unit/flag_test.rb} +19 -25
  59. data/test/{tc_gli.rb → unit/gli_test.rb} +78 -50
  60. data/test/{tc_help.rb → unit/help_test.rb} +54 -113
  61. data/test/{tc_options.rb → unit/options_test.rb} +4 -4
  62. data/test/unit/subcommand_parsing_test.rb +263 -0
  63. data/test/unit/subcommands_test.rb +245 -0
  64. data/test/{config.yaml → unit/support/gli_test_config.yml} +1 -0
  65. data/test/unit/switch_test.rb +49 -0
  66. data/test/{tc_terminal.rb → unit/terminal_test.rb} +28 -3
  67. data/test/unit/test_helper.rb +13 -0
  68. data/test/unit/verbatim_wrapper_test.rb +24 -0
  69. metadata +85 -141
  70. data/.ruby-gemset +0 -1
  71. data/.ruby-version +0 -1
  72. data/.travis.yml +0 -12
  73. data/ObjectModel.graffle +0 -1191
  74. data/bin/report_on_rake_results +0 -10
  75. data/bin/test_all_rubies.sh +0 -6
  76. data/features/gli_executable.feature +0 -90
  77. data/features/gli_init.feature +0 -232
  78. data/features/step_definitions/gli_executable_steps.rb +0 -18
  79. data/features/step_definitions/gli_init_steps.rb +0 -11
  80. data/features/step_definitions/todo_steps.rb +0 -100
  81. data/features/support/env.rb +0 -55
  82. data/features/todo.feature +0 -546
  83. data/features/todo_legacy.feature +0 -128
  84. data/test/option_test_helper.rb +0 -13
  85. data/test/tc_compound_command.rb +0 -22
  86. data/test/tc_subcommand_parsing.rb +0 -104
  87. data/test/tc_subcommands.rb +0 -259
  88. data/test/tc_switch.rb +0 -55
  89. data/test/tc_verbatim_wrapper.rb +0 -36
  90. data/test/test_helper.rb +0 -20
  91. /data/test/{init_simplecov.rb → unit/init_simplecov.rb} +0 -0
  92. /data/test/{fake_std_out.rb → unit/support/fake_std_out.rb} +0 -0
@@ -1,10 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require 'yaml'
3
- require 'rainbow'
4
-
5
- results = YAML::load(STDIN)
6
- success = results["successes"] || []
7
- errors = results["errors"] || []
8
- success.each { |ruby| puts ruby.color(:green) }
9
- errors.each { |ruby| puts ruby.color(:red) }
10
- exit -1 unless errors.empty?
@@ -1,6 +0,0 @@
1
- echo tests
2
- rvm 1.9.2@gli-dev,1.9.3@gli-dev,1.8.7@gli-dev,jruby@gli-dev,rbx@gli-dev,ree@gli-dev --yaml rake test | bin/report_on_rake_results
3
- rake clobber > /dev/null 2>&1
4
- echo features
5
- rvm 1.9.2@gli-dev,1.9.3@gli-dev,1.8.7@gli-dev,jruby@gli-dev,rbx@gli-dev,ree@gli-dev --yaml rake features | bin/report_on_rake_results
6
- rake clobber > /dev/null 2>&1
@@ -1,90 +0,0 @@
1
- Feature: The GLI executable works as intended
2
- As a developer who wants to make a GLI-powered command-line app
3
- When I use the app provided by GLI
4
- I get a reasonably working application
5
-
6
- Background:
7
- Given I have GLI installed
8
- And my terminal size is "80x24"
9
-
10
- Scenario Outline: Getting Help for GLI
11
- When I run `gli <command>`
12
- Then the exit status should be 0
13
- And the output should contain:
14
- """
15
- NAME
16
- gli - create scaffolding for a GLI-powered application
17
-
18
- SYNOPSIS
19
- gli [global options] command [command options] [arguments...]
20
-
21
- VERSION
22
- """
23
- And the output should contain:
24
- """
25
- GLOBAL OPTIONS
26
- --help - Show this message
27
- -n - Dry run; dont change the disk
28
- -r, --root=arg - Root dir of project (default: .)
29
- -v - Be verbose
30
- --version - Display the program version
31
-
32
- COMMANDS
33
- help - Shows a list of commands or help for one command
34
- init, scaffold - Create a new GLI-based project
35
- """
36
-
37
- Examples:
38
- |command|
39
- | |
40
- |help |
41
-
42
-
43
- Scenario Outline: Getting help on scaffolding
44
- When I run `gli help <command>`
45
- Then the exit status should be 0
46
- And the output should contain:
47
- """
48
- NAME
49
- init - Create a new GLI-based project
50
-
51
- SYNOPSIS
52
- gli [global options] init [command options] project_name [command[ command]*]
53
-
54
- DESCRIPTION
55
- This will create a scaffold command line project that uses GLI for command
56
- line processing. Specifically, this will create an executable ready to go,
57
- as well as a lib and test directory, all inside the directory named for your
58
- project
59
-
60
- COMMAND OPTIONS
61
- -e, --[no-]ext - Create an ext dir
62
- --[no-]force - Overwrite/ignore existing files and directories
63
- --notest - Do not create a test or features dir
64
- """
65
-
66
- Examples:
67
- |command |
68
- |init |
69
- |scaffold |
70
-
71
-
72
- Scenario: GLI correctly identifies non-existent command
73
- When I run `gli foobar`
74
- Then the exit status should not be 0
75
- And the stderr should contain "error: Unknown command 'foobar'"
76
-
77
- Scenario: GLI correctly identifies non-existent global flag
78
- When I run `gli -q help`
79
- Then the exit status should not be 0
80
- And the stderr should contain "error: Unknown option -q"
81
-
82
- Scenario: GLI correctly identifies non-existent command flag
83
- When I run `gli init -q`
84
- Then the exit status should not be 0
85
- And the stderr should contain "error: Unknown option -q"
86
-
87
- Scenario: The _doc command doesn't blow up
88
- Given the file "gli.rdoc" doesn't exist
89
- When I run `gli _doc`
90
- Then a file named "gli.rdoc" should exist
@@ -1,232 +0,0 @@
1
- Feature: The scaffold GLI generates works
2
- As a developer who wants to make a GLI-powered command-line app
3
- When I generate a GLI-powered app
4
- Things work out of the box
5
-
6
- Background:
7
- Given I have GLI installed
8
- And GLI's libs are in my path
9
- And my terminal size is "80x24"
10
-
11
- Scenario: Scaffold generates and things look good
12
- When I run `gli init --rvmrc todo add complete list`
13
- Then the exit status should be 0
14
- And the output should contain exactly:
15
- """
16
- Creating dir ./todo/lib...
17
- Creating dir ./todo/bin...
18
- Creating dir ./todo/test...
19
- Created ./todo/bin/todo
20
- Created ./todo/README.rdoc
21
- Created ./todo/todo.rdoc
22
- Created ./todo/todo.gemspec
23
- Created ./todo/test/default_test.rb
24
- Created ./todo/test/test_helper.rb
25
- Created ./todo/Rakefile
26
- Created ./todo/Gemfile
27
- Created ./todo/features
28
- Created ./todo/lib/todo/version.rb
29
- Created ./todo/lib/todo.rb
30
- Created ./todo/.rvmrc
31
-
32
- """
33
- And the following directories should exist:
34
- |todo |
35
- |todo/bin |
36
- |todo/test |
37
- |todo/lib |
38
- And the following files should exist:
39
- |todo/bin/todo |
40
- |todo/README.rdoc |
41
- |todo/todo.rdoc |
42
- |todo/todo.gemspec |
43
- |todo/test/default_test.rb |
44
- |todo/test/test_helper.rb |
45
- |todo/Rakefile |
46
- |todo/Gemfile |
47
- |todo/lib/todo/version.rb |
48
- |todo/lib/todo.rb |
49
- |todo/.rvmrc |
50
- When I cd to "todo"
51
- And I make sure todo's lib dir is in my lib path
52
- And I run `bin/todo`
53
- Then the output should contain:
54
- """
55
- NAME
56
- todo - Describe your application here
57
-
58
- SYNOPSIS
59
- todo [global options] command [command options] [arguments...]
60
-
61
- VERSION
62
- 0.0.1
63
-
64
- GLOBAL OPTIONS
65
- -f, --flagname=The name of the argument - Describe some flag here (default:
66
- the default)
67
- --help - Show this message
68
- -s, --[no-]switch - Describe some switch here
69
- --version - Display the program version
70
-
71
- COMMANDS
72
- add - Describe add here
73
- complete - Describe complete here
74
- help - Shows a list of commands or help for one command
75
- list - Describe list here
76
-
77
- """
78
- And I run `bin/todo --help`
79
- Then the output should contain:
80
- """
81
- NAME
82
- todo - Describe your application here
83
-
84
- SYNOPSIS
85
- todo [global options] command [command options] [arguments...]
86
-
87
- VERSION
88
- 0.0.1
89
-
90
- GLOBAL OPTIONS
91
- -f, --flagname=The name of the argument - Describe some flag here (default:
92
- the default)
93
- --help - Show this message
94
- -s, --[no-]switch - Describe some switch here
95
- --version - Display the program version
96
-
97
- COMMANDS
98
- add - Describe add here
99
- complete - Describe complete here
100
- help - Shows a list of commands or help for one command
101
- list - Describe list here
102
-
103
- """
104
- When I run `bin/todo help add`
105
- Then the output should contain:
106
- """
107
- NAME
108
- add - Describe add here
109
- """
110
- And the output should contain:
111
- """
112
- SYNOPSIS
113
- todo [global options] add [command options] Describe arguments to add here
114
- """
115
- And the output should contain:
116
- """
117
- COMMAND OPTIONS
118
- -f arg - Describe a flag to add (default: default)
119
- -s - Describe a switch to add
120
- """
121
- When I run `rake test`
122
- Then the output should contain:
123
- """
124
- .
125
- """
126
- And the output should contain:
127
- """
128
-
129
- 1 tests, 1 assertions, 0 failures, 0 errors
130
- """
131
- Given todo's libs are no longer in my load path
132
- When I run `rake features`
133
- Then the output should contain:
134
- """
135
- 1 scenario (1 passed)
136
- """
137
- And the output should contain:
138
- """
139
- 2 steps (2 passed)
140
- """
141
-
142
- Scenario Outline: Scaffold generates and respects flags to create ext dir and avoid test dir
143
- When I run `<command>`
144
- Then the exit status should be 0
145
- And the output should contain exactly:
146
- """
147
- Creating dir ./todo/lib...
148
- Creating dir ./todo/bin...
149
- Creating dir ./todo/ext...
150
- Created ./todo/bin/todo
151
- Created ./todo/README.rdoc
152
- Created ./todo/todo.rdoc
153
- Created ./todo/todo.gemspec
154
- Created ./todo/Rakefile
155
- Created ./todo/Gemfile
156
- Created ./todo/lib/todo/version.rb
157
- Created ./todo/lib/todo.rb
158
-
159
- """
160
- And the following directories should exist:
161
- |todo |
162
- |todo/bin |
163
- |todo/ext |
164
- |todo/lib |
165
- And the following directories should not exist:
166
- |todo/test|
167
- And the following files should exist:
168
- |todo/bin/todo |
169
- |todo/README.rdoc |
170
- |todo/todo.rdoc |
171
- |todo/todo.gemspec |
172
- |todo/Rakefile |
173
- |todo/Gemfile |
174
- |todo/lib/todo/version.rb |
175
- |todo/lib/todo.rb |
176
-
177
- Examples:
178
- | command |
179
- | gli init -e --notest todo add complete list |
180
- | gli init todo add complete list -e --notest |
181
-
182
- Scenario: Running commands the normal way
183
- Given I successfully run `gli init todo add complete compute list`
184
- And I cd to "todo"
185
- And I make sure todo's lib dir is in my lib path
186
- When I successfully run `bin/todo add`
187
- Then the output should contain "add command ran"
188
- When I successfully run `bin/todo complete`
189
- Then the output should contain "complete command ran"
190
- When I run `bin/todo foobar`
191
- Then the stderr should contain "error: Unknown command 'foobar'"
192
- And the exit status should not be 0
193
-
194
- Scenario: Running commands using short form
195
- Given I successfully run `gli init todo add complete compute list`
196
- And I cd to "todo"
197
- And I make sure todo's lib dir is in my lib path
198
- When I successfully run `bin/todo a`
199
- Then the output should contain "add command ran"
200
- When I successfully run `bin/todo l`
201
- Then the output should contain "list command ran"
202
- When I successfully run `bin/todo compl`
203
- Then the output should contain "complete command ran"
204
-
205
- Scenario: Ambiguous commands give helpful output
206
- Given I successfully run `gli init todo add complete compute list`
207
- And I cd to "todo"
208
- And I make sure todo's lib dir is in my lib path
209
- When I run `bin/todo comp`
210
- Then the stderr should contain "Ambiguous command 'comp'. It matches complete,compute"
211
- And the exit status should not be 0
212
-
213
- Scenario: Running generated command without bundler gives a helpful error message
214
- Given I successfully run `gli init todo add complete compute list`
215
- And I cd to "todo"
216
- When I run `bin/todo comp`
217
- Then the exit status should not be 0
218
- Then the stderr should contain "In development, you need to use `bundle exec bin/todo` to run your app"
219
- And the stderr should contain "At install-time, RubyGems will make sure lib, etc. are in the load path"
220
- And the stderr should contain "Feel free to remove this message from bin/todo now"
221
-
222
- Scenario: Running commands with a dash in the name
223
- Given I successfully run `gli init todo-app add complete compute list`
224
- And I cd to "todo-app"
225
- And I make sure todo's lib dir is in my lib path
226
- When I successfully run `bin/todo-app add`
227
- Then the output should contain "add command ran"
228
- When I successfully run `bin/todo-app complete`
229
- Then the output should contain "complete command ran"
230
- When I run `bin/todo-app foobar`
231
- Then the stderr should contain "error: Unknown command 'foobar'"
232
- And the exit status should not be 0
@@ -1,18 +0,0 @@
1
- Given /^I have GLI installed$/ do
2
- add_to_lib_path(GLI_LIB_PATH)
3
- end
4
-
5
- Given /^my terminal size is "([^"]*)"$/ do |terminal_size|
6
- if terminal_size =~/^(\d+)x(\d+)$/
7
- ENV['COLUMNS'] = $1
8
- ENV['LINES'] = $2
9
- else
10
- raise "Terminal size should be COLxLines, e.g. 80x24"
11
- end
12
- end
13
-
14
-
15
- Given /^the file "(.*?)" doesn't exist$/ do |filename|
16
- FileUtils.rm filename if File.exists?(filename)
17
- end
18
-
@@ -1,11 +0,0 @@
1
- Given /^GLI's libs are in my path$/ do
2
- ENV['RUBYLIB'] = GLI_LIB_PATH
3
- end
4
-
5
- Given /^I make sure todo's lib dir is in my lib path$/ do
6
- add_to_lib_path("./lib")
7
- end
8
-
9
- Given /^todo's libs are no longer in my load path$/ do
10
- remove_from_lib_path("./lib")
11
- end
@@ -1,100 +0,0 @@
1
- Given /^todo_legacy's bin directory is in my path/ do
2
- add_to_path(File.expand_path(File.join(File.dirname(__FILE__),'..','..','test','apps','todo_legacy','bin')))
3
- end
4
-
5
- Given /^todo's bin directory is in my path/ do
6
- add_to_path(File.expand_path(File.join(File.dirname(__FILE__),'..','..','test','apps','todo','bin')))
7
- end
8
-
9
- Given /^the todo app is coded to avoid sorted help commands$/ do
10
- ENV['TODO_SORT_HELP'] = 'manually'
11
- end
12
-
13
- Given /^the todo app is coded to avoid wrapping text$/ do
14
- ENV['TODO_WRAP_HELP_TEXT'] = 'one_line'
15
- end
16
-
17
- Given /^the todo app is coded to wrap text only for tty$/ do
18
- ENV['TODO_WRAP_HELP_TEXT'] = 'tty_only'
19
- end
20
-
21
- Given /^the todo app is coded to hide commands without description$/ do
22
- ENV['HIDE_COMMANDS_WITHOUT_DESC'] = 'true'
23
- end
24
-
25
- Given /^a clean home directory$/ do
26
- FileUtils.rm_rf File.join(ENV['HOME'],'gli_test_todo.rc')
27
- end
28
-
29
- Then /^the config file should contain a section for each command and subcommand$/ do
30
- config = File.open(File.join(ENV['HOME'],'gli_test_todo.rc')) do |file|
31
- YAML::load(file)
32
- end
33
- config.keys.should include(:flag)
34
- config[:flag].should == 'foo'
35
- config[:flag].tap do |flag|
36
- if flag.respond_to?(:encoding)
37
- flag.encoding.name.should == 'UTF-8'
38
- end
39
- end
40
- config.keys.should include(:switch)
41
- config[:switch].should == true
42
- config.keys.should include(:otherswitch)
43
- config[:otherswitch].should == false
44
- config.keys.should include('commands')
45
- %w(chained chained2 create first list ls second).map(&:to_sym).each do |command_name|
46
- config['commands'].keys.should include(command_name)
47
- end
48
- config['commands'][:create].keys.should include('commands')
49
- config['commands'][:create]['commands'].should include(:tasks)
50
- config['commands'][:create]['commands'].should include(:contexts)
51
-
52
- config['commands'][:list].keys.should include('commands')
53
- config['commands'][:list]['commands'].should include(:tasks)
54
- config['commands'][:list]['commands'].should include(:contexts)
55
- end
56
-
57
- Given /^a config file that specifies defaults for some commands with subcommands$/ do
58
- @config = {
59
- 'commands' => {
60
- :list => {
61
- 'commands' => {
62
- :tasks => {
63
- :flag => 'foobar',
64
- },
65
- :contexts => {
66
- :otherflag => 'crud',
67
- },
68
- }
69
- }
70
- }
71
- }
72
- File.open(File.join(ENV['HOME'],'gli_test_todo.rc'),'w') do |file|
73
- file.puts @config.to_yaml
74
- end
75
- end
76
-
77
- Then /^I should see the defaults for '(.*)' from the config file in the help$/ do |command_path|
78
- if command_path == 'list tasks'
79
- step %{the output should match /--flag.*default: foobar/}
80
- unescape(all_output).should_not =~ /#{unescape("--otherflag.*default: crud")}/m
81
- elsif command_path == 'list contexts'
82
- step %{the output should match /--otherflag.*default: crud/}
83
- unescape(all_output).should_not =~ /#{unescape("--flag.*default: foobar")}/m
84
- else
85
- raise "Don't know how to test for command path #{command_path}"
86
- end
87
- end
88
-
89
-
90
- Given /^the todo app is coded to use verbatim formatting$/ do
91
- ENV['TODO_WRAP_HELP_TEXT'] = 'verbatim'
92
- end
93
-
94
- Given(/^my terminal is (\d+) characters wide$/) do |terminal_width|
95
- ENV['COLUMNS'] = terminal_width.to_s
96
- end
97
-
98
- Given(/^my app is configured for "(.*?)" synopses$/) do |synopsis|
99
- ENV['SYNOPSES'] = synopsis
100
- end
@@ -1,55 +0,0 @@
1
- begin
2
- require 'simplecov'
3
- SimpleCov.start
4
- rescue LoadError
5
- # Don't care
6
- end
7
- require 'aruba/cucumber'
8
- require 'fileutils'
9
-
10
- # Adds GLI's bin dir to our path
11
- ENV['PATH'] = "#{File.expand_path(File.dirname(__FILE__) + '/../../bin')}#{File::PATH_SEPARATOR}#{ENV['PATH']}"
12
- GLI_LIB_PATH = File.expand_path(File.join(File.dirname(__FILE__),'..','..','lib'))
13
-
14
- GLI_GEMSET = 'gli-testing'
15
- TMP_PATH = 'tmp/aruba'
16
-
17
- Before do
18
- unset_bundler_env_vars
19
- # Not sure how else to get this dynamically
20
- @dirs = [TMP_PATH]
21
- @aruba_timeout_seconds = 5
22
- @original_path = ENV['PATH'].split(File::PATH_SEPARATOR)
23
- @original_home = ENV['HOME']
24
- new_home = "/tmp/fakehome"
25
- FileUtils.rm_rf new_home
26
- FileUtils.mkdir new_home
27
- ENV['HOME'] = new_home
28
- FileUtils.cp 'gli.rdoc','gli.rdoc.orig'
29
- end
30
-
31
- After do |scenario|
32
- ENV['RUBYLIB'] = ''
33
- todo_app_dir = File.join(TMP_PATH,'todo')
34
- if File.exists? todo_app_dir
35
- FileUtils.rm_rf(todo_app_dir)
36
- end
37
- ENV['PATH'] = @original_path.join(File::PATH_SEPARATOR)
38
- ENV['HOME'] = @original_home
39
- ENV['TODO_SORT_HELP'] = nil
40
- ENV['TODO_WRAP_HELP_TEXT'] = nil
41
- ENV['HIDE_COMMANDS_WITHOUT_DESC'] = nil
42
- FileUtils.mv 'gli.rdoc.orig','gli.rdoc'
43
- end
44
-
45
- def add_to_path(dir)
46
- ENV['PATH'] = "#{dir}#{File::PATH_SEPARATOR}#{ENV['PATH']}"
47
- end
48
-
49
- def add_to_lib_path(path)
50
- ENV["RUBYLIB"] = (String(ENV["RUBYLIB"]).split(File::PATH_SEPARATOR) + [path]).join(File::PATH_SEPARATOR)
51
- end
52
-
53
- def remove_from_lib_path(path)
54
- ENV["RUBYLIB"] = (String(ENV["RUBYLIB"]).split(File::PATH_SEPARATOR) - [path]).join(File::PATH_SEPARATOR)
55
- end