mirror of
https://github.com/lostisland/faraday.git
synced 2025-10-16 00:03:37 -04:00
add script/console
This commit is contained in:
parent
1aed2d1b17
commit
5f1d2bf19e
6
script/console
Executable file
6
script/console
Executable file
@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env ruby
|
||||
require 'rubygems'
|
||||
require 'irb'
|
||||
require File.expand_path("../ruby", __FILE__)
|
||||
require File.expand_path("../../lib/#{MakeScript.lib_name}", __FILE__)
|
||||
IRB.start
|
22
script/ruby.rb
Normal file
22
script/ruby.rb
Normal file
@ -0,0 +1,22 @@
|
||||
module MakeScript
|
||||
extend self
|
||||
|
||||
def lib_name
|
||||
@lib_name ||= Dir['*.gemspec'].first.split('.').first
|
||||
end
|
||||
|
||||
def version
|
||||
@version ||= begin
|
||||
line = File.read("lib/#{lib_name}.rb")[/^\s*VERSION\s*=\s*.*/]
|
||||
line.match(/.*VERSION\s*=\s*['"](.*)['"]/)[1]
|
||||
end
|
||||
end
|
||||
|
||||
def gemspec_file
|
||||
@gemspec_file ||= "#{lib_name}.gemspec"
|
||||
end
|
||||
|
||||
def gem_file
|
||||
@gem_file ||= "#{lib_name}-#{version}.gem"
|
||||
end
|
||||
end
|
Loading…
x
Reference in New Issue
Block a user