ripl-padrino 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ pkg/*
2
+ *.gem
3
+ .bundle
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in ripl-padrino.gemspec
4
+ gemspec
data/README.md ADDED
@@ -0,0 +1,38 @@
1
+ # ripl-padrino #
2
+
3
+ ([ripl](https://github.com/cldwalker/ripl)) is a light, modular alternative to irb. this is ripl for ([padrino](https://github.com/padrino/padrino-framework)).
4
+
5
+ ## Install & Setup ##
6
+
7
+ $ gem install ripl-padrino.
8
+
9
+ After that, just go to the root of the project directory and then run:
10
+
11
+ $ ripl-padrino
12
+
13
+ Want to change the environment? Append it after the command:
14
+
15
+ $ ripl-padrino test
16
+
17
+ ## Commands ##
18
+
19
+ The basic commands available from padrino's console are also available like:
20
+
21
+ >> reload!
22
+
23
+ which reloads the padrino project.
24
+
25
+ >> applications
26
+
27
+ which shows the applications in the padrino project.
28
+
29
+
30
+ #### Note on Patches/Pull Requests
31
+
32
+ * Fork the project.
33
+ * Make your feature addition or bug fix.
34
+ * Add tests for it. This is important so I don't break it in a
35
+ future version unintentionally.
36
+ * Commit, do not mess with rakefile, version, or history.
37
+ (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
38
+ * Send me a pull request. Bonus points for topic branches.
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
data/bin/ripl-padrino ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require 'ripl'
3
+ require 'ripl/padrino'
4
+ Ripl.start
@@ -0,0 +1,20 @@
1
+ module Ripl
2
+ module Padrino
3
+ module Commands
4
+ # Reloads classes
5
+ def reload!
6
+ ::Padrino.reload!
7
+ end
8
+
9
+ # Show applications
10
+ def applications
11
+ puts "==== List of Mounted Applications ====\n\n"
12
+ ::Padrino.mounted_apps.each do |app|
13
+ puts " * %-10s mapped to %s" % [app.name, app.uri_root]
14
+ end
15
+ puts
16
+ ::Padrino.mounted_apps.collect { |app| "#{app.name} => #{app.uri_root}" }
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,35 @@
1
+ require 'ripl'
2
+ require File.expand_path('../commands',__FILE__)
3
+
4
+ module Ripl
5
+ module Padrino
6
+ VERSION = '0.0.1'
7
+
8
+ def before_loop
9
+ load_padrino
10
+ super
11
+ end
12
+
13
+ def load_padrino
14
+ boot_path = File.join(Dir.pwd,'config/boot.rb')
15
+ ENV["PADRINO_ENV"] ||= ARGV.first
16
+ ENV["RACK_ENV"] = ENV["PADRINO_ENV"] # Also set this for middleware
17
+ unless File.exist?(boot_path)
18
+ puts "=> Could not find boot file in: #{boot_path} !!!"
19
+ raise SystemExit
20
+ else
21
+ require File.join(Dir.pwd,'config/boot.rb')
22
+ puts "=> Loading #{ENV["PADRINO_ENV"]} console (Padrino v.#{::Padrino.version})"
23
+ # Load apps
24
+ ::Padrino.mounted_apps.each do |app|
25
+ puts "=> Loading Application #{app.app_class}"
26
+ app.app_obj.setup_application!
27
+ end
28
+ end
29
+ end
30
+
31
+ end
32
+ end
33
+
34
+ Ripl::Shell.include Ripl::Padrino if defined? Ripl::Padrino
35
+ Ripl::Commands.include Ripl::Padrino::Commands if defined? Ripl::Padrino::Commands
@@ -0,0 +1,23 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "ripl/padrino"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "ripl-padrino"
7
+ s.version = Ripl::Padrino::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Arthur Chiu"]
10
+ s.email = ["mr.arthur.chiu@gmail.com"]
11
+ s.homepage = "http://arthurchiu.tumblr.com"
12
+ s.summary = %q{ripl for padrino}
13
+ s.description = %q{ripl for the padrino framework}
14
+
15
+ s.rubyforge_project = "ripl-padrino"
16
+
17
+ s.files = `git ls-files`.split("\n")
18
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
+ s.require_paths = ["lib"]
21
+
22
+ s.add_dependency 'ripl', '~>0.3.0'
23
+ end
metadata ADDED
@@ -0,0 +1,90 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ripl-padrino
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Arthur Chiu
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-01-09 00:00:00 -08:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: ripl
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ hash: 19
30
+ segments:
31
+ - 0
32
+ - 3
33
+ - 0
34
+ version: 0.3.0
35
+ type: :runtime
36
+ version_requirements: *id001
37
+ description: ripl for the padrino framework
38
+ email:
39
+ - mr.arthur.chiu@gmail.com
40
+ executables:
41
+ - ripl-padrino
42
+ extensions: []
43
+
44
+ extra_rdoc_files: []
45
+
46
+ files:
47
+ - .gitignore
48
+ - Gemfile
49
+ - README.md
50
+ - Rakefile
51
+ - bin/ripl-padrino
52
+ - lib/ripl/commands.rb
53
+ - lib/ripl/padrino.rb
54
+ - ripl-padrino.gemspec
55
+ has_rdoc: true
56
+ homepage: http://arthurchiu.tumblr.com
57
+ licenses: []
58
+
59
+ post_install_message:
60
+ rdoc_options: []
61
+
62
+ require_paths:
63
+ - lib
64
+ required_ruby_version: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ hash: 3
70
+ segments:
71
+ - 0
72
+ version: "0"
73
+ required_rubygems_version: !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ hash: 3
79
+ segments:
80
+ - 0
81
+ version: "0"
82
+ requirements: []
83
+
84
+ rubyforge_project: ripl-padrino
85
+ rubygems_version: 1.3.7
86
+ signing_key:
87
+ specification_version: 3
88
+ summary: ripl for padrino
89
+ test_files: []
90
+