repl_rake 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4dc2159741f60a627053c6fe42f2fbaae2e58ecb
4
+ data.tar.gz: 69adc48864e63d66e7924182edb1cf11453c52f2
5
+ SHA512:
6
+ metadata.gz: 1279cd90b2b5370c610bfeb3e22d6d8d9d12eff84af9870f6c60291cc8c39eb574e9183e18ba2d44a2595346fff52b390c8ebc526feb0fa368144360ef6ce9bd
7
+ data.tar.gz: 59d2f6d475728ba6f8ad89620e900c25e1b72710e6976940a2e9968d6ef56c8f086d8499d4e8d78dcf5619566fc9b27f249b08cd86e80aa2c2973368f7442a7c
data/.gitignore ADDED
@@ -0,0 +1,18 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ coverage
6
+ InstalledFiles
7
+ lib/bundler/man
8
+ pkg
9
+ rdoc
10
+ spec/reports
11
+ test/tmp
12
+ test/version_tmp
13
+ tmp
14
+
15
+ # YARD artifacts
16
+ .yardoc
17
+ _yardoc
18
+ doc/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in repl_rake.gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,25 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ repl_rake (0.0.1)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ coderay (1.1.0)
10
+ method_source (0.8.2)
11
+ pry (0.9.12.6)
12
+ coderay (~> 1.0)
13
+ method_source (~> 0.8)
14
+ slop (~> 3.4)
15
+ rake (10.1.0)
16
+ slop (3.4.7)
17
+
18
+ PLATFORMS
19
+ ruby
20
+
21
+ DEPENDENCIES
22
+ bundler (~> 1.5)
23
+ pry
24
+ rake
25
+ repl_rake!
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Zander Hill
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Zander Hill
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,38 @@
1
+ # ReplRake
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'repl_rake'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install repl_rake
18
+
19
+ ## Usage
20
+
21
+ Then in gem folder add this to Rakefile
22
+
23
+ require 'repl_rake'
24
+ ReplRake.setup
25
+
26
+ ## Credits
27
+
28
+ Credits:
29
+ - Origin of Idea: http://erniemiller.org/2014/02/05/7-lines-every-gems-rakefile-should-have/#comment-1232335498
30
+ - Rake tasks require solution: https://stackoverflow.com/questions/15446153/ruby-rake-load-tasks-from-a-gem
31
+
32
+ ## Contributing
33
+
34
+ 1. Fork it ( http://github.com/<my-github-username>/repl_rake/fork )
35
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
36
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
37
+ 4. Push to the branch (`git push origin my-new-feature`)
38
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/lib/repl_rake.rb ADDED
@@ -0,0 +1,21 @@
1
+ require "repl_rake/version"
2
+ require 'rake'
3
+
4
+ module ReplRake
5
+
6
+ def self.setup
7
+ gem_spec = Gem::Specification.new(Dir["*.gemspec"].first)
8
+ $calling_gem_name = gem_spec.name.split('.').first
9
+ spec = Gem::Specification.find_by_name 'repl_rake'
10
+ call_best_repl(spec.gem_dir)
11
+ end
12
+
13
+ def self.call_best_repl(spec_gem_dir)
14
+ begin
15
+ spec = Gem::Specification.find_by_name 'pry'
16
+ load "#{spec_gem_dir}/lib/repl_rake/tasks/pry.rake"
17
+ rescue Gem::LoadError => e
18
+ load "#{spec_gem_dir}/lib/repl_rake/tasks/irb.rake"
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,8 @@
1
+ task :console do
2
+ require 'irb'
3
+ require 'irb/completion'
4
+ # TODO: maybe dynamically set it in Rakefile and then retrieve from ENV?
5
+ require "#{$calling_gem_name}"
6
+ ARGV.clear
7
+ IRB.start
8
+ end
@@ -0,0 +1,7 @@
1
+ task :console do
2
+ require 'pry'
3
+ # find the current folder and the matching gemspec
4
+ require "#{$calling_gem_name}"
5
+ ARGV.clear
6
+ Pry.start
7
+ end
@@ -0,0 +1,3 @@
1
+ module ReplRake
2
+ VERSION = "0.0.1"
3
+ end
data/repl_rake.gemspec ADDED
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'repl_rake/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "repl_rake"
8
+ spec.version = ReplRake::VERSION
9
+ spec.authors = ["Zander Hill"]
10
+ spec.email = ["Zander@civet.ws"]
11
+ spec.summary = %q{Creates a `rake console` task with either Pry or Irb}
12
+ spec.homepage = ""
13
+ spec.license = "MIT"
14
+
15
+ spec.files = `git ls-files`.split($/)
16
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ["lib"]
19
+
20
+ spec.add_development_dependency "bundler", "~> 1.5"
21
+ spec.add_development_dependency "pry"
22
+ spec.add_development_dependency "rake"
23
+ end
metadata ADDED
@@ -0,0 +1,99 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: repl_rake
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Zander Hill
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-02-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.5'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.5'
27
+ - !ruby/object:Gem::Dependency
28
+ name: pry
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description:
56
+ email:
57
+ - Zander@civet.ws
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - .gitignore
63
+ - Gemfile
64
+ - Gemfile.lock
65
+ - LICENSE
66
+ - LICENSE.txt
67
+ - README.md
68
+ - Rakefile
69
+ - lib/repl_rake.rb
70
+ - lib/repl_rake/tasks/irb.rake
71
+ - lib/repl_rake/tasks/pry.rake
72
+ - lib/repl_rake/version.rb
73
+ - repl_rake.gemspec
74
+ homepage: ''
75
+ licenses:
76
+ - MIT
77
+ metadata: {}
78
+ post_install_message:
79
+ rdoc_options: []
80
+ require_paths:
81
+ - lib
82
+ required_ruby_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - '>='
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - '>='
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ requirements: []
93
+ rubyforge_project:
94
+ rubygems_version: 2.0.3
95
+ signing_key:
96
+ specification_version: 4
97
+ summary: Creates a `rake console` task with either Pry or Irb
98
+ test_files: []
99
+ has_rdoc: