yap-shell 0.7.1 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +9 -24
  3. data/Gemfile +1 -5
  4. data/LICENSE.txt +17 -18
  5. data/README.md +28 -14
  6. data/Rakefile +4 -1
  7. data/bin/yap +1 -3
  8. data/lib/.gitkeep +0 -0
  9. data/yap-shell.gemspec +12 -11
  10. metadata +19 -184
  11. data/.rspec +0 -2
  12. data/.travis.yml +0 -11
  13. data/DESIGN.md +0 -87
  14. data/Gemfile.travis +0 -8
  15. data/Gemfile.travis.lock +0 -104
  16. data/WISHLIST.md +0 -54
  17. data/bin/yap-dev +0 -45
  18. data/lib/tasks/gem.rake +0 -62
  19. data/lib/yap.rb +0 -52
  20. data/lib/yap/addon.rb +0 -24
  21. data/lib/yap/addon/base.rb +0 -52
  22. data/lib/yap/addon/export_as.rb +0 -12
  23. data/lib/yap/addon/loader.rb +0 -84
  24. data/lib/yap/addon/path.rb +0 -56
  25. data/lib/yap/addon/rc_file.rb +0 -21
  26. data/lib/yap/addon/reference.rb +0 -22
  27. data/lib/yap/cli.rb +0 -4
  28. data/lib/yap/cli/commands.rb +0 -6
  29. data/lib/yap/cli/commands/addon.rb +0 -14
  30. data/lib/yap/cli/commands/addon/disable.rb +0 -35
  31. data/lib/yap/cli/commands/addon/enable.rb +0 -35
  32. data/lib/yap/cli/commands/addon/list.rb +0 -37
  33. data/lib/yap/cli/commands/addon/search.rb +0 -99
  34. data/lib/yap/cli/commands/generate.rb +0 -13
  35. data/lib/yap/cli/commands/generate/addon.rb +0 -258
  36. data/lib/yap/cli/commands/generate/addonrb.template +0 -22
  37. data/lib/yap/cli/commands/generate/gemspec.template +0 -25
  38. data/lib/yap/cli/commands/generate/license.template +0 -21
  39. data/lib/yap/cli/commands/generate/rakefile.template +0 -6
  40. data/lib/yap/cli/commands/generate/readme.template +0 -40
  41. data/lib/yap/cli/options.rb +0 -162
  42. data/lib/yap/cli/options/addon.rb +0 -64
  43. data/lib/yap/cli/options/addon/disable.rb +0 -62
  44. data/lib/yap/cli/options/addon/enable.rb +0 -63
  45. data/lib/yap/cli/options/addon/list.rb +0 -65
  46. data/lib/yap/cli/options/addon/search.rb +0 -76
  47. data/lib/yap/cli/options/generate.rb +0 -59
  48. data/lib/yap/cli/options/generate/addon.rb +0 -63
  49. data/lib/yap/configuration.rb +0 -74
  50. data/lib/yap/gem_helper.rb +0 -195
  51. data/lib/yap/gem_tasks.rb +0 -6
  52. data/lib/yap/shell.rb +0 -116
  53. data/lib/yap/shell/aliases.rb +0 -58
  54. data/lib/yap/shell/builtins.rb +0 -18
  55. data/lib/yap/shell/builtins/alias.rb +0 -42
  56. data/lib/yap/shell/builtins/cd.rb +0 -57
  57. data/lib/yap/shell/builtins/env.rb +0 -11
  58. data/lib/yap/shell/commands.rb +0 -163
  59. data/lib/yap/shell/evaluation.rb +0 -439
  60. data/lib/yap/shell/evaluation/shell_expansions.rb +0 -99
  61. data/lib/yap/shell/event_emitter.rb +0 -18
  62. data/lib/yap/shell/execution.rb +0 -16
  63. data/lib/yap/shell/execution/builtin_command_execution.rb +0 -20
  64. data/lib/yap/shell/execution/command_execution.rb +0 -30
  65. data/lib/yap/shell/execution/context.rb +0 -128
  66. data/lib/yap/shell/execution/file_system_command_execution.rb +0 -137
  67. data/lib/yap/shell/execution/result.rb +0 -18
  68. data/lib/yap/shell/execution/ruby_command_execution.rb +0 -80
  69. data/lib/yap/shell/execution/shell_command_execution.rb +0 -30
  70. data/lib/yap/shell/prompt.rb +0 -21
  71. data/lib/yap/shell/repl.rb +0 -237
  72. data/lib/yap/shell/version.rb +0 -5
  73. data/lib/yap/world.rb +0 -286
  74. data/rcfiles/yaprc +0 -390
  75. data/scripts/4 +0 -8
  76. data/scripts/bg-vim +0 -4
  77. data/scripts/fail +0 -3
  78. data/scripts/letters +0 -8
  79. data/scripts/lots-of-output +0 -6
  80. data/scripts/pass +0 -3
  81. data/scripts/simulate-long-running +0 -4
  82. data/scripts/write-to-stderr.rb +0 -3
  83. data/scripts/write-to-stdout.rb +0 -3
  84. data/spec/features/addons/generating_an_addon_spec.rb +0 -55
  85. data/spec/features/addons/using_an_addon_spec.rb +0 -182
  86. data/spec/features/aliases_spec.rb +0 -78
  87. data/spec/features/environment_variables_spec.rb +0 -69
  88. data/spec/features/filesystem_commands_spec.rb +0 -61
  89. data/spec/features/first_time_spec.rb +0 -45
  90. data/spec/features/grouping_spec.rb +0 -81
  91. data/spec/features/line_editing_spec.rb +0 -174
  92. data/spec/features/range_spec.rb +0 -35
  93. data/spec/features/redirection_spec.rb +0 -234
  94. data/spec/features/repetition_spec.rb +0 -118
  95. data/spec/features/shell_expansions_spec.rb +0 -127
  96. data/spec/spec_helper.rb +0 -172
  97. data/spec/support/matchers/have_not_printed.rb +0 -30
  98. data/spec/support/matchers/have_printed.rb +0 -68
  99. data/spec/support/very_soon.rb +0 -9
  100. data/spec/support/yap_spec_dsl.rb +0 -258
  101. data/test.rb +0 -206
  102. data/update-rawline.sh +0 -6
@@ -1,64 +0,0 @@
1
- module Yap
2
- module Cli
3
- class Options::Addon
4
- include OptionsLoader
5
-
6
- attr_reader :command, :options
7
-
8
- def initialize(options:)
9
- @options = options
10
- end
11
-
12
- def parse(args)
13
- option_parser.order!(args)
14
- end
15
-
16
- def command
17
- @command
18
- end
19
-
20
- def help_message
21
- option_parser.to_s
22
- end
23
-
24
- private
25
-
26
- def set_command(command)
27
- @command = load_command('addon').new
28
- end
29
-
30
- def option_parser
31
- OptionParser.new do |opts|
32
- opts.banner = <<-TEXT.gsub(/^\s*\|/, '')
33
- |Usage: #{opts.program_name} addon [command] [addon-name] [options]
34
- |
35
- |#{Term::ANSIColor.cyan('yap addon')} can be used to control yap addons
36
- |
37
- |Generate commands:
38
- |
39
- | #{Term::ANSIColor.yellow('enable')} - enables a yap addon
40
- | #{Term::ANSIColor.yellow('disable')} - disables a yap addon
41
- |
42
- |Generate options:
43
- TEXT
44
-
45
- opts.on('-h', '--help', 'Prints this help') do
46
- puts opts
47
- puts
48
- puts <<-TEXT.gsub(/^\s*\|/, '')
49
- |Example: disabling an addon
50
- |
51
- | #{opts.program_name} addon disable foo-bar
52
- |
53
- |Example: enabling an addon
54
- |
55
- | #{opts.program_name} addon enable foo-bar
56
- |
57
- TEXT
58
- exit 0
59
- end
60
- end
61
- end
62
- end
63
- end
64
- end
@@ -1,62 +0,0 @@
1
- module Yap
2
- module Cli
3
- class Options::Addon::Disable
4
- include OptionsLoader
5
-
6
- attr_reader :command, :options
7
-
8
- def initialize(options:)
9
- @options = options
10
- end
11
-
12
- def parse(args)
13
- @addon_name = args.shift unless args.first =~ /^-/
14
- unless @addon_name
15
- args.unshift '--help'
16
- STDERR.puts "Missing addon-name!"
17
- @exit_status = 1
18
- puts
19
- end
20
- option_parser.order!(args)
21
- end
22
-
23
- def command
24
- @command ||= load_command('addon/disable').new(@addon_name)
25
- end
26
-
27
- def help_message
28
- option_parser.to_s
29
- end
30
-
31
- private
32
-
33
- def option_parser
34
- OptionParser.new do |opts|
35
- opts.banner = <<-TEXT.gsub(/^\s*\|/, '')
36
- |Usage: #{opts.program_name} addon disable [addon-name] [options]
37
- |
38
- |#{Term::ANSIColor.cyan('yap addon disable')} can be used to disable yap addons.
39
- |
40
- |Addon disable options:
41
- TEXT
42
-
43
- opts.on('-h', '--help', 'Prints this help') do
44
- puts opts
45
- puts
46
- puts <<-TEXT.gsub(/^\s*\|/, '')
47
- |Example: Disable an addon
48
- |
49
- | #{opts.program_name} addon disable magical-key-bindings
50
- |
51
- |Example: Enable an addon
52
- |
53
- | #{opts.program_name} addon disable magical-key-bindings
54
- |
55
- TEXT
56
- exit @exit_status
57
- end
58
- end
59
- end
60
- end
61
- end
62
- end
@@ -1,63 +0,0 @@
1
- module Yap
2
- module Cli
3
- class Options::Addon::Enable
4
- include OptionsLoader
5
-
6
- attr_reader :command, :options
7
-
8
- def initialize(options:)
9
- @options = options
10
- @exit_status = 0
11
- end
12
-
13
- def parse(args)
14
- @addon_name = args.shift unless args.first =~ /^-/
15
- unless @addon_name
16
- args.unshift '--help'
17
- STDERR.puts "Missing addon-name!"
18
- @exit_status = 1
19
- puts
20
- end
21
- option_parser.order!(args)
22
- end
23
-
24
- def command
25
- @command ||= load_command('addon/enable').new(@addon_name)
26
- end
27
-
28
- def help_message
29
- option_parser.to_s
30
- end
31
-
32
- private
33
-
34
- def option_parser
35
- OptionParser.new do |opts|
36
- opts.banner = <<-TEXT.gsub(/^\s*\|/, '')
37
- |Usage: #{opts.program_name} addon enable [addon-name] [options]
38
- |
39
- |#{Term::ANSIColor.cyan('yap addon enable')} can be used to enable yap addons.
40
- |
41
- |Addon enable options:
42
- TEXT
43
-
44
- opts.on('-h', '--help', 'Prints this help') do
45
- puts opts
46
- puts
47
- puts <<-TEXT.gsub(/^\s*\|/, '')
48
- |Example: Disable an addon
49
- |
50
- | #{opts.program_name} addon disable magical-key-bindings
51
- |
52
- |Example: Enable an addon
53
- |
54
- | #{opts.program_name} addon enable magical-key-bindings
55
- |
56
- TEXT
57
- exit @exit_status
58
- end
59
- end
60
- end
61
- end
62
- end
63
- end
@@ -1,65 +0,0 @@
1
- module Yap
2
- module Cli
3
- class Options::Addon::List
4
- include OptionsLoader
5
-
6
- attr_reader :command, :options
7
-
8
- def initialize(options:)
9
- @options = options
10
- end
11
-
12
- def parse(args)
13
- option_parser.order!(args)
14
- end
15
-
16
- def command
17
- @command ||= load_command('addon/list').new
18
- end
19
-
20
- def help_message
21
- option_parser.to_s
22
- end
23
-
24
- private
25
-
26
- def option_parser
27
- OptionParser.new do |opts|
28
- opts.banner = <<-TEXT.gsub(/^\s*\|/, '')
29
- |Usage: #{opts.program_name} addon list [options]
30
- |
31
- |#{Term::ANSIColor.cyan('yap addon list')} can be used to list yap addons.
32
- |
33
- |Addon list options:
34
- TEXT
35
-
36
- opts.on('-h', '--help', 'Prints this help') do
37
- puts opts
38
- puts
39
- puts <<-TEXT.gsub(/^\s*\|/, '')
40
- |Example: Listing all addons
41
- |
42
- | #{opts.program_name} addon list
43
- |
44
- |Example: Listing disabled addons only
45
- |
46
- | #{opts.program_name} addon list --disabled
47
- |
48
- |Example: Listing enabled addons only
49
- |
50
- | #{opts.program_name} addon list --enabled
51
- |
52
- TEXT
53
- exit 0
54
- end
55
- opts.on('--enabled', 'Lists yap addons that are enabled') do
56
- command.filter = :enabled
57
- end
58
- opts.on('--disabled', 'Lists yap addons that are disabled') do
59
- command.filter = :disabled
60
- end
61
- end
62
- end
63
- end
64
- end
65
- end
@@ -1,76 +0,0 @@
1
- module Yap
2
- module Cli
3
- class Options::Addon::Search
4
- include OptionsLoader
5
-
6
- attr_reader :command, :options
7
-
8
- def initialize(options:)
9
- @options = options
10
- end
11
-
12
- def parse(args)
13
- search_terms = []
14
- while args.any?
15
- option_parser.order!(args)
16
- search_terms << args.shift
17
- end
18
- command.search_term = search_terms.shift
19
- end
20
-
21
- def command
22
- @command ||= load_command('addon/search').new
23
- end
24
-
25
- def help_message
26
- option_parser.to_s
27
- end
28
-
29
- private
30
-
31
- def option_parser
32
- OptionParser.new do |opts|
33
- opts.banner = <<-TEXT.gsub(/^\s*\|/, '')
34
- |Usage: #{opts.program_name} addon search [options] [addon-name]
35
- |
36
- |#{Term::ANSIColor.cyan('yap addon search')} can be used to search for yap addons.
37
- |
38
- |Addon search options:
39
- TEXT
40
-
41
- opts.on('-h', '--help', 'Prints this help') do
42
- puts opts
43
- puts
44
- puts <<-TEXT.gsub(/^\s*\|/, '')
45
- |Example: Search for an addon
46
- |
47
- | #{opts.program_name} addon search --local foo
48
- |
49
- |Example: Search for an addon locally (no network access)
50
- |
51
- | #{opts.program_name} addon search foo
52
- |
53
- TEXT
54
- exit 0
55
- end
56
- opts.on('--local', 'Search locally, no network access') do
57
- command.local = true
58
- end
59
- opts.on('-a', '--all', 'Display all addon versions') do
60
- command.all = true
61
- end
62
- opts.on('--prerelease', 'Display prerelease versions') do
63
- command.prerelease = true
64
- end
65
- opts.on('--gem-name', 'Display rubygem name instead of shortened yap addon name') do
66
- command.show_gem_name = true
67
- end
68
- opts.on('-v', '--version VERSION', 'Specify version of addon to search') do |version|
69
- command.version = version
70
- end
71
-
72
- end
73
- end
74
- end
75
- end
76
- end
@@ -1,59 +0,0 @@
1
- module Yap
2
- module Cli
3
- class Options::Generate
4
- include OptionsLoader
5
-
6
- attr_reader :command, :options
7
-
8
- def initialize(options:)
9
- @options = options
10
- @exit_status = 0
11
- end
12
-
13
- def parse(args)
14
- if args.empty?
15
- args.unshift '--help'
16
- STDERR.puts "generate must be called with a component type!"
17
- @exit_status = 1
18
- puts
19
- end
20
-
21
- option_parser.order!(args)
22
- end
23
-
24
- def command
25
- @command ||= load_command('generate').new
26
- end
27
-
28
- private
29
-
30
- def option_parser
31
- OptionParser.new do |opts|
32
- opts.banner = <<-TEXT.gsub(/^\s*\|/, '')
33
- |Usage: #{opts.program_name} generate [component-type] [options]
34
- |
35
- |#{Term::ANSIColor.cyan('yap generate')} can be used to generate yap components, like an addon.
36
- |
37
- |Generate commands:
38
- |
39
- | #{Term::ANSIColor.yellow('addon')} - generates a yap addon skeleton
40
- |
41
- |Generate options:
42
- TEXT
43
-
44
- opts.on('-h', '--help', 'Prints this help') do
45
- puts opts
46
- puts
47
- puts <<-TEXT.gsub(/^\s*\|/, '')
48
- |Example: Generating an addon
49
- |
50
- | #{opts.program_name} generate addon magical-key-bindings
51
- |
52
- TEXT
53
- exit @exit_status
54
- end
55
- end
56
- end
57
- end
58
- end
59
- end
@@ -1,63 +0,0 @@
1
- module Yap
2
- module Cli
3
- class Options::Generate::Addon
4
- include OptionsLoader
5
-
6
- attr_reader :command, :options
7
-
8
- def initialize(options:)
9
- @options = options
10
- @exit_status = 0
11
- end
12
-
13
- def parse(args)
14
- @addon_name = args.shift unless args.first =~ /^-/
15
- unless @addon_name
16
- args.unshift '--help'
17
- STDERR.puts "Missing addon-name!"
18
- @exit_status = 1
19
- puts
20
- end
21
- option_parser.order!(args)
22
- end
23
-
24
- def command
25
- @command ||= load_command('generate/addon').new(@addon_name)
26
- end
27
-
28
- def help_message
29
- option_parser.to_s
30
- end
31
-
32
- private
33
-
34
- def option_parser
35
- OptionParser.new do |opts|
36
- opts.banner = <<-TEXT.gsub(/^\s*\|/, '')
37
- |Usage: #{opts.program_name} generate addon [addon-name] [options]
38
- |
39
- |#{Term::ANSIColor.cyan('yap addon')} can be used to generate a yap addon skeleton provided an addon name.
40
- |
41
- |Generate addon options:
42
- TEXT
43
-
44
- opts.on('-h', '--help', 'Prints this help') do
45
- puts opts
46
- puts
47
- puts <<-TEXT.gsub(/^\s*\|/, '')
48
- |Example: Generating an addon
49
- |
50
- | #{opts.program_name} generate addon magical-key-bindings
51
- |
52
- TEXT
53
- exit @exit_status
54
- end
55
-
56
- opts.on('--skip-git', 'Skip git initialization') do
57
- command.use_git = false
58
- end
59
- end
60
- end
61
- end
62
- end
63
- end