rib 1.2.91 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 88c5f2ae8689754dbb4170da0bb88795aec2d883
4
- data.tar.gz: 28c9823c064fe74870020570f6fd5c97ad304eab
3
+ metadata.gz: 1076f17c46a51eb9e569ab5f7471f42dd3b1c3cc
4
+ data.tar.gz: 7d9af36e6f5b15a18a01cde080ebbb4cb93023c8
5
5
  SHA512:
6
- metadata.gz: 8fc90a4a128b0b2ad85c235afe10ff64694fb43e6f4c44e296f8359f304f9ea66b0c960b9d82a5f481d464f56714695361671ac791923570dfb2553c60b54f29
7
- data.tar.gz: 7af336679010d281f72953ae0517a56414faeed302d5fb91de18ee68053984407948fbe2ad12d16ebfbb05385db8317b13cedd1d701f29dcfe7bb8155f35efa6
6
+ metadata.gz: 18c8aba3e10d59143db113e3d2cb95c1a77764ad82f3b420994e3fd5d032998eb6280681a6f34247db699635f2641d1d34d2373600be5d7b7fdda5cc0e9c161e
7
+ data.tar.gz: 5838f68537399c9981d81540be7deb0bb537ea00ce529e68b114f286dd3094d08b06dbd1fbc8b805e113f32dd7e7fc58c4402a95d3bbe23432ef5bd258c8fb77
@@ -3,7 +3,7 @@ language: ruby
3
3
  rvm:
4
4
  - 2.1
5
5
  - 2.2
6
- - 2.3.0
6
+ - 2.3.1
7
7
  - rbx
8
8
  - jruby-9
9
9
 
@@ -11,5 +11,5 @@ before_install:
11
11
  - rvm get head
12
12
  - rvm reload
13
13
  - rvm use --install $TRAVIS_RUBY_VERSION --binary --latest
14
- install: 'bundle install --retry=3'
14
+ install: 'gem install bundler; bundle install --retry=3'
15
15
  script: 'ruby -r bundler/setup -S rake test'
data/CHANGES.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # CHANGES
2
2
 
3
+ ## Rib 1.3.0 -- 2016-06-28
4
+
5
+ * Now `rib` would accept `-p` or `--prefix` to allow setting where we want to
6
+ load the application. This is useful when we don't want to `cd` into a
7
+ directory and `rib auto` or `rib rails` from there.
8
+
3
9
  ## Rib 1.2.91 -- 2016-01-06
4
10
 
5
11
  * [core/multiline] Fixed a case for JRuby 9.0.4.0.
data/README.md CHANGED
@@ -336,7 +336,7 @@ simple, simpler than rib-rails.
336
336
 
337
337
  Apache License 2.0
338
338
 
339
- Copyright (c) 2011-2015, Lin Jen-Shin (godfat)
339
+ Copyright (c) 2011-2016, Lin Jen-Shin (godfat)
340
340
 
341
341
  Licensed under the Apache License, Version 2.0 (the "License");
342
342
  you may not use this file except in compliance with the License.
data/Rakefile CHANGED
@@ -10,5 +10,5 @@ Gemgem.init(dir) do |s|
10
10
  require 'rib/version'
11
11
  s.name = 'rib'
12
12
  s.version = Rib::VERSION
13
- %w[].each{ |g| s.add_runtime_dependency(g) }
13
+ s.files.delete('screenshot.png')
14
14
  end
data/TODO.md CHANGED
@@ -1,9 +1,5 @@
1
1
  # TODO
2
2
 
3
- * make that `rib auto` or `rib rack` accept an argument to locate the app
4
-
5
- * Fix whenever Color.enabled? but StripBacktrace.disabled?
6
-
7
3
  * Runner tests
8
4
  * Documentation
9
5
  * Implement exception_spy
data/lib/rib.rb CHANGED
@@ -11,7 +11,9 @@ module Rib
11
11
  #
12
12
  # @api public
13
13
  def config
14
- @config ||= {:config => File.join(home, 'config.rb'), :name => 'rib'}
14
+ @config ||= {:name => 'rib',
15
+ :config => File.join(home, 'config.rb'),
16
+ :prefix => '.'}
15
17
  end
16
18
 
17
19
  # All shells in the memory
@@ -13,13 +13,17 @@ module Rib::Rack
13
13
  def load_rack
14
14
  require 'rack'
15
15
  Rib.abort("Error: Cannot find config.ru") unless rack?
16
- app, _ = Rack::Builder.parse_file('config.ru')
16
+ app, _ = Rack::Builder.parse_file(configru_path)
17
17
  self.app = app
18
18
  Rib.shell.eval_binding.eval('def app; Rib::Rack.app; end')
19
19
  Rib.say("Access your app via :app method")
20
20
  end
21
21
 
22
22
  def rack?
23
- File.exist?('config.ru')
23
+ File.exist?(configru_path)
24
+ end
25
+
26
+ def configru_path
27
+ "#{Rib.config[:prefix]}/config.ru"
24
28
  end
25
29
  end
@@ -9,9 +9,9 @@ module Rib::Rails
9
9
  end
10
10
 
11
11
  def load_rails
12
- require './config/boot'
12
+ require path_for('boot')
13
13
 
14
- if File.exist?('./config/application.rb')
14
+ if File.exist?(path_for('application.rb'))
15
15
  Rib::Rails.load_rails3
16
16
  else
17
17
  Rib::Rails.load_rails2
@@ -30,8 +30,8 @@ module Rib::Rails
30
30
  }
31
31
 
32
32
  # copied from commands/console
33
- ['./config/environment',
34
- 'console_app' ,
33
+ [path_for('environment'),
34
+ 'console_app',
35
35
  'console_with_helpers'].each{ |f| require f }
36
36
 
37
37
  optparse_rails
@@ -41,7 +41,7 @@ module Rib::Rails
41
41
  optparse_env
42
42
 
43
43
  # copied from rails/commands
44
- require './config/application'
44
+ require path_for('application')
45
45
  ::Rails.application.require_environment!
46
46
 
47
47
  optparse_rails
@@ -106,7 +106,11 @@ module Rib::Rails
106
106
  end
107
107
 
108
108
  def rails?
109
- File.exist?('./config/boot.rb') &&
110
- File.exist?('./config/environment.rb')
109
+ File.exist?(path_for('boot.rb')) &&
110
+ File.exist?(path_for('environment.rb'))
111
+ end
112
+
113
+ def path_for file
114
+ "#{Rib.config[:prefix]}/config/#{file}"
111
115
  end
112
116
  end
@@ -10,16 +10,20 @@ module Rib::Ramaze
10
10
 
11
11
  def load_ramaze
12
12
  # try to produce consistent error message, and yet lazy loading ramaze
13
- require './start' unless ramaze?
13
+ require start_path unless ramaze?
14
14
 
15
15
  require 'ramaze'
16
16
  ::Ramaze.options.started = true
17
17
 
18
- require './start'
18
+ require start_path
19
19
  at_exit{ puts('Ramazement has ended, go in peace.') }
20
20
  end
21
21
 
22
22
  def ramaze?
23
- File.exist?('./start.rb')
23
+ File.exist?(start_path)
24
+ end
25
+
26
+ def start_path
27
+ "#{Rib.config[:prefix]}/start.rb"
24
28
  end
25
29
  end
@@ -23,6 +23,7 @@ module Rib::Runner
23
23
 
24
24
  ['rib options:' , '' ],
25
25
  ['-c, --config FILE', 'Load config from FILE' ],
26
+ ['-p, --prefix PATH', 'Prefix to locate the app. Default to .' ],
26
27
  ['-n, --no-config' , 'Suppress loading ~/.config/rib/config.rb'],
27
28
  ['-h, --help' , 'Print this message' ],
28
29
  ['-v, --version' , 'Print the version' ]] +
@@ -67,14 +68,14 @@ module Rib::Runner
67
68
  def run argv=ARGV
68
69
  (@running_commands ||= []) << Rib.config[:name]
69
70
  unused = parse(argv)
70
- # if it's running a Rib command, the loop would be inside Rib itself
71
- # so here we only parse args for the command
72
- return if @running_commands.pop != 'rib'
73
- # by coming to this line, it means now we're running Rib main loop,
74
- # not any other Rib command
75
- Rib.warn("Unused arguments: #{unused.inspect}") unless unused.empty?
76
- require 'rib/core' if Rib.config.delete(:mimic_irb)
77
- loop
71
+ # we only want to run the loop if we're running the rib command,
72
+ # otherwise, it must be a rib app, which we only want to parse
73
+ # the arguments and proceed (this is recursive!)
74
+ if @running_commands.pop == 'rib'
75
+ Rib.warn("Unused arguments: #{unused.inspect}") unless unused.empty?
76
+ require 'rib/core' if Rib.config.delete(:mimic_irb)
77
+ loop
78
+ end
78
79
  end
79
80
 
80
81
  def loop retry_times=5
@@ -121,6 +122,9 @@ module Rib::Runner
121
122
  when /^-c=?(.+)?/, /^--config=?(.+)?/
122
123
  Rib.config[:config] = $1 || argv.shift
123
124
 
125
+ when /^-p=?(.+)?/, /^--prefix=?(.+)?/
126
+ Rib.config[:prefix] = $1 || argv.shift
127
+
124
128
  when /^-n/, '--no-config'
125
129
  Rib.config.delete(:config)
126
130
  parse_next(argv, arg)
@@ -1,4 +1,4 @@
1
1
 
2
2
  module Rib
3
- VERSION = '1.2.91'
3
+ VERSION = '1.3.0'
4
4
  end
@@ -1,108 +1,107 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: rib 1.2.91 ruby lib
2
+ # stub: rib 1.3.0 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
- s.name = "rib"
6
- s.version = "1.2.91"
5
+ s.name = "rib".freeze
6
+ s.version = "1.3.0"
7
7
 
8
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
9
- s.require_paths = ["lib"]
10
- s.authors = ["Lin Jen-Shin (godfat)"]
11
- s.date = "2016-01-06"
12
- s.description = "Ruby-Interactive-ruBy -- Yet another interactive Ruby shell\n\nRib is based on the design of [ripl][] and the work of [ripl-rc][], some of\nthe features are also inspired by [pry][]. The aim of Rib is to be fully\nfeatured and yet very easy to opt-out or opt-in other features. It shall\nbe simple, lightweight and modular so that everyone could customize Rib.\n\n[ripl]: https://github.com/cldwalker/ripl\n[ripl-rc]: https://github.com/godfat/ripl-rc\n[pry]: https://github.com/pry/pry"
13
- s.email = ["godfat (XD) godfat.org"]
8
+ s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
9
+ s.require_paths = ["lib".freeze]
10
+ s.authors = ["Lin Jen-Shin (godfat)".freeze]
11
+ s.date = "2016-06-28"
12
+ s.description = "Ruby-Interactive-ruBy -- Yet another interactive Ruby shell\n\nRib is based on the design of [ripl][] and the work of [ripl-rc][], some of\nthe features are also inspired by [pry][]. The aim of Rib is to be fully\nfeatured and yet very easy to opt-out or opt-in other features. It shall\nbe simple, lightweight and modular so that everyone could customize Rib.\n\n[ripl]: https://github.com/cldwalker/ripl\n[ripl-rc]: https://github.com/godfat/ripl-rc\n[pry]: https://github.com/pry/pry".freeze
13
+ s.email = ["godfat (XD) godfat.org".freeze]
14
14
  s.executables = [
15
- "rib",
16
- "rib-all",
17
- "rib-auto",
18
- "rib-min",
19
- "rib-rack",
20
- "rib-rails",
21
- "rib-ramaze"]
15
+ "rib".freeze,
16
+ "rib-all".freeze,
17
+ "rib-auto".freeze,
18
+ "rib-min".freeze,
19
+ "rib-rack".freeze,
20
+ "rib-rails".freeze,
21
+ "rib-ramaze".freeze]
22
22
  s.files = [
23
- ".gitignore",
24
- ".gitmodules",
25
- ".travis.yml",
26
- "CHANGES.md",
27
- "Gemfile",
28
- "LICENSE",
29
- "README.md",
30
- "Rakefile",
31
- "TODO.md",
32
- "bin/rib",
33
- "bin/rib-all",
34
- "bin/rib-auto",
35
- "bin/rib-min",
36
- "bin/rib-rack",
37
- "bin/rib-rails",
38
- "bin/rib-ramaze",
39
- "lib/rib.rb",
40
- "lib/rib/all.rb",
41
- "lib/rib/api.rb",
42
- "lib/rib/app/auto.rb",
43
- "lib/rib/app/rack.rb",
44
- "lib/rib/app/rails.rb",
45
- "lib/rib/app/ramaze.rb",
46
- "lib/rib/config.rb",
47
- "lib/rib/core.rb",
48
- "lib/rib/core/completion.rb",
49
- "lib/rib/core/history.rb",
50
- "lib/rib/core/multiline.rb",
51
- "lib/rib/core/readline.rb",
52
- "lib/rib/core/squeeze_history.rb",
53
- "lib/rib/core/strip_backtrace.rb",
54
- "lib/rib/core/underscore.rb",
55
- "lib/rib/debug.rb",
56
- "lib/rib/extra/autoindent.rb",
57
- "lib/rib/extra/hirb.rb",
58
- "lib/rib/extra/paging.rb",
59
- "lib/rib/extra/spring.rb",
60
- "lib/rib/more.rb",
61
- "lib/rib/more/anchor.rb",
62
- "lib/rib/more/bottomup_backtrace.rb",
63
- "lib/rib/more/color.rb",
64
- "lib/rib/more/edit.rb",
65
- "lib/rib/more/multiline_history.rb",
66
- "lib/rib/more/multiline_history_file.rb",
67
- "lib/rib/plugin.rb",
68
- "lib/rib/runner.rb",
69
- "lib/rib/shell.rb",
70
- "lib/rib/test.rb",
71
- "lib/rib/test/multiline.rb",
72
- "lib/rib/version.rb",
73
- "rib.gemspec",
74
- "screenshot.png",
75
- "task/README.md",
76
- "task/gemgem.rb",
77
- "test/core/test_completion.rb",
78
- "test/core/test_history.rb",
79
- "test/core/test_multiline.rb",
80
- "test/core/test_readline.rb",
81
- "test/core/test_squeeze_history.rb",
82
- "test/core/test_underscore.rb",
83
- "test/extra/test_autoindent.rb",
84
- "test/more/test_color.rb",
85
- "test/more/test_multiline_history.rb",
86
- "test/test_api.rb",
87
- "test/test_plugin.rb",
88
- "test/test_runner.rb",
89
- "test/test_shell.rb"]
90
- s.homepage = "https://github.com/godfat/rib"
91
- s.licenses = ["Apache License 2.0"]
92
- s.rubygems_version = "2.5.1"
93
- s.summary = "Ruby-Interactive-ruBy -- Yet another interactive Ruby shell"
23
+ ".gitignore".freeze,
24
+ ".gitmodules".freeze,
25
+ ".travis.yml".freeze,
26
+ "CHANGES.md".freeze,
27
+ "Gemfile".freeze,
28
+ "LICENSE".freeze,
29
+ "README.md".freeze,
30
+ "Rakefile".freeze,
31
+ "TODO.md".freeze,
32
+ "bin/rib".freeze,
33
+ "bin/rib-all".freeze,
34
+ "bin/rib-auto".freeze,
35
+ "bin/rib-min".freeze,
36
+ "bin/rib-rack".freeze,
37
+ "bin/rib-rails".freeze,
38
+ "bin/rib-ramaze".freeze,
39
+ "lib/rib.rb".freeze,
40
+ "lib/rib/all.rb".freeze,
41
+ "lib/rib/api.rb".freeze,
42
+ "lib/rib/app/auto.rb".freeze,
43
+ "lib/rib/app/rack.rb".freeze,
44
+ "lib/rib/app/rails.rb".freeze,
45
+ "lib/rib/app/ramaze.rb".freeze,
46
+ "lib/rib/config.rb".freeze,
47
+ "lib/rib/core.rb".freeze,
48
+ "lib/rib/core/completion.rb".freeze,
49
+ "lib/rib/core/history.rb".freeze,
50
+ "lib/rib/core/multiline.rb".freeze,
51
+ "lib/rib/core/readline.rb".freeze,
52
+ "lib/rib/core/squeeze_history.rb".freeze,
53
+ "lib/rib/core/strip_backtrace.rb".freeze,
54
+ "lib/rib/core/underscore.rb".freeze,
55
+ "lib/rib/debug.rb".freeze,
56
+ "lib/rib/extra/autoindent.rb".freeze,
57
+ "lib/rib/extra/hirb.rb".freeze,
58
+ "lib/rib/extra/paging.rb".freeze,
59
+ "lib/rib/extra/spring.rb".freeze,
60
+ "lib/rib/more.rb".freeze,
61
+ "lib/rib/more/anchor.rb".freeze,
62
+ "lib/rib/more/bottomup_backtrace.rb".freeze,
63
+ "lib/rib/more/color.rb".freeze,
64
+ "lib/rib/more/edit.rb".freeze,
65
+ "lib/rib/more/multiline_history.rb".freeze,
66
+ "lib/rib/more/multiline_history_file.rb".freeze,
67
+ "lib/rib/plugin.rb".freeze,
68
+ "lib/rib/runner.rb".freeze,
69
+ "lib/rib/shell.rb".freeze,
70
+ "lib/rib/test.rb".freeze,
71
+ "lib/rib/test/multiline.rb".freeze,
72
+ "lib/rib/version.rb".freeze,
73
+ "rib.gemspec".freeze,
74
+ "task/README.md".freeze,
75
+ "task/gemgem.rb".freeze,
76
+ "test/core/test_completion.rb".freeze,
77
+ "test/core/test_history.rb".freeze,
78
+ "test/core/test_multiline.rb".freeze,
79
+ "test/core/test_readline.rb".freeze,
80
+ "test/core/test_squeeze_history.rb".freeze,
81
+ "test/core/test_underscore.rb".freeze,
82
+ "test/extra/test_autoindent.rb".freeze,
83
+ "test/more/test_color.rb".freeze,
84
+ "test/more/test_multiline_history.rb".freeze,
85
+ "test/test_api.rb".freeze,
86
+ "test/test_plugin.rb".freeze,
87
+ "test/test_runner.rb".freeze,
88
+ "test/test_shell.rb".freeze]
89
+ s.homepage = "https://github.com/godfat/rib".freeze
90
+ s.licenses = ["Apache License 2.0".freeze]
91
+ s.rubygems_version = "2.6.4".freeze
92
+ s.summary = "Ruby-Interactive-ruBy -- Yet another interactive Ruby shell".freeze
94
93
  s.test_files = [
95
- "test/core/test_completion.rb",
96
- "test/core/test_history.rb",
97
- "test/core/test_multiline.rb",
98
- "test/core/test_readline.rb",
99
- "test/core/test_squeeze_history.rb",
100
- "test/core/test_underscore.rb",
101
- "test/extra/test_autoindent.rb",
102
- "test/more/test_color.rb",
103
- "test/more/test_multiline_history.rb",
104
- "test/test_api.rb",
105
- "test/test_plugin.rb",
106
- "test/test_runner.rb",
107
- "test/test_shell.rb"]
94
+ "test/core/test_completion.rb".freeze,
95
+ "test/core/test_history.rb".freeze,
96
+ "test/core/test_multiline.rb".freeze,
97
+ "test/core/test_readline.rb".freeze,
98
+ "test/core/test_squeeze_history.rb".freeze,
99
+ "test/core/test_underscore.rb".freeze,
100
+ "test/extra/test_autoindent.rb".freeze,
101
+ "test/more/test_color.rb".freeze,
102
+ "test/more/test_multiline_history.rb".freeze,
103
+ "test/test_api.rb".freeze,
104
+ "test/test_plugin.rb".freeze,
105
+ "test/test_runner.rb".freeze,
106
+ "test/test_shell.rb".freeze]
108
107
  end
@@ -41,7 +41,7 @@ describe Rib::SqueezeHistory do
41
41
  end
42
42
 
43
43
  after do
44
- FileUtils.rm_f(@history)
44
+ FileUtils.rm_f(@history) if Rib::History.enabled?
45
45
  end
46
46
 
47
47
  paste :squeeze_history
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rib
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.91
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lin Jen-Shin (godfat)
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-06 00:00:00.000000000 Z
11
+ date: 2016-06-28 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |-
14
14
  Ruby-Interactive-ruBy -- Yet another interactive Ruby shell
@@ -85,7 +85,6 @@ files:
85
85
  - lib/rib/test/multiline.rb
86
86
  - lib/rib/version.rb
87
87
  - rib.gemspec
88
- - screenshot.png
89
88
  - task/README.md
90
89
  - task/gemgem.rb
91
90
  - test/core/test_completion.rb
@@ -121,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
120
  version: '0'
122
121
  requirements: []
123
122
  rubyforge_project:
124
- rubygems_version: 2.5.1
123
+ rubygems_version: 2.6.4
125
124
  signing_key:
126
125
  specification_version: 4
127
126
  summary: Ruby-Interactive-ruBy -- Yet another interactive Ruby shell
Binary file