Class: Palco::Gemspec
Instance Attribute Summary
Attributes inherited from FileBase
#email, #file_content, #full_path_name, #root_dir, #user_name
Instance Method Summary collapse
-
#initialize(root_dir) ⇒ Gemspec
constructor
A new instance of Gemspec.
Methods inherited from FileBase
#create, #exists?, #find, #read, #write
Constructor Details
#initialize(root_dir) ⇒ Gemspec
Returns a new instance of Gemspec.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/palco/gemspec.rb', line 4 def initialize(root_dir) super(root_dir, "sinatra_#{root_dir}.gemspec") @file_content = "# -*- encoding: utf-8 -*-" @file_content << "$:.push File.expand_path(\"../lib\", __FILE__)\n" @file_content << "require \"palco/version\"\n" @file_content << "Gem::Specification.new do |s|\n" @file_content << "s.name = \"#{root_dir}\"\n" @file_content << "s.version = #{root_dir.capitalize}::VERSION\n" @file_content << "s.authors = [\"#{self.user_name}\"]\n" @file_content << "s.email = [\"#{self.email}\"]\n" @file_content << "s.homepage = \"add your project homepage\"\n" @file_content << "s.summary = %q{write a great summary here}\n" @file_content << "s.description = %q{write a great description here}\n" @file_content << "\n" @file_content << "s.rubyforge_project = \"#{root_dir}\"\n" @file_content << "\n" @file_content << "s.files = `git ls-files`.split(\"\\n\")\n" @file_content << "s.test_files = `git ls-files -- {test,spec,features}/*`.split(\"\\n\")\n" @file_content << "s.executables = `git ls-files -- bin/*`.split(\"\\n\").map{ |f| File.basename(f) }\n" @file_content << "s.require_paths = [\"lib\"]\n" @file_content << "# specify any dependencies here; for example:\n" @file_content << "# s.add_development_dependency \"rspec\"\n" @file_content << "end\n" end |