Class: Jeweler::Generator
Defined Under Namespace
Modules: GithubMixin
Classes: Options
Instance Method Summary
collapse
#after_render_template, #create_bin, #create_db_structure, #create_ffi_structure, #create_lib, #create_meta, #create_plugin_files, #create_rails_engine, #create_test_data, #output_template_in_target_generic, #output_template_in_target_generic_append, #render_template_generic, #template_dir_biogem
#bin_dir, #bin_name, #db_dir, #exists_dir?, #ext_dir, #lib_dir, #lib_filename, #lib_plugin_dir, #lib_plugin_filename, #path, #require_name, #short_name, #test_data_dir
#engine_dirs, #engine_filename, #engine_module_name, #engine_name, #engine_name_prefix, #engine_namespace, #lib_sub_module, #sub_module
Constructor Details
#initialize(options = {}) ⇒ Generator
Returns a new instance of Generator.
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/bio-gem/mod/jeweler.rb', line 18
def initialize(options = {})
original_initialize(options)
development_dependencies.delete_if { |k,v| k == "rcov" }
development_dependencies << ["bio", ">= 1.4.2"]
development_dependencies << ["rdoc","~> 3.12"]
if options[:biogem_db]
development_dependencies << ["activerecord", ">= 3.0.7"]
development_dependencies << ["activesupport", ">= 3.0.7"]
development_dependencies << ["sqlite3", ">= 1.3.3"]
end
end
|
Instance Method Details
#create_and_push_repo ⇒ Object
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
# File 'lib/bio-gem/mod/jeweler.rb', line 71
def create_and_push_repo
return if $UNITTEST begin
Net::HTTP.post_form URI.parse('http://github.com/api/v2/yaml/repos/create'),
'login' => github_username,
'token' => github_token,
'description' => summary,
'name' => github_repo_name
rescue SocketError => se
puts_template_message("Seems you are not connected to Internet, can't create a remote repository. Do not forget to create it by hand, from GitHub, and sync it with this project.")
end
end
|
#create_files ⇒ Object
this is the default directory for storing library datasets creates a data directory for every needs. the options are defined in mod/jeweler/options.rb
56
57
58
|
# File 'lib/bio-gem/mod/jeweler.rb', line 56
def create_files
create_plugin_files
end
|
#original_create_files ⇒ Object
52
|
# File 'lib/bio-gem/mod/jeweler.rb', line 52
alias original_create_files create_files
|
#original_initialize ⇒ Object
17
|
# File 'lib/bio-gem/mod/jeweler.rb', line 17
alias original_initialize initialize
|
#original_project_name ⇒ Object
33
|
# File 'lib/bio-gem/mod/jeweler.rb', line 33
alias original_project_name project_name
|
#original_render_template ⇒ Object
40
|
# File 'lib/bio-gem/mod/jeweler.rb', line 40
alias original_render_template render_template
|
#project_name ⇒ Object
34
35
36
37
38
|
# File 'lib/bio-gem/mod/jeweler.rb', line 34
def project_name
name = original_project_name
return 'bio-'+name if name !~ /^bio-/
name
end
|
#puts_template_message(message, length = 70, padding = 4) ⇒ Object
60
61
62
63
64
65
66
67
68
69
|
# File 'lib/bio-gem/mod/jeweler.rb', line 60
def puts_template_message(message, length=70, padding=4)
puts "*"*(length+padding*2+2)
puts "*"+" "*(length+padding*2)+"*"
message=message.join("\n") if message.kind_of? Array
message.scan(/.{1,70}/).map do |sub_message|
puts "*"+" "*padding+sub_message+" "*(length-sub_message.size+padding)+"*"
end
puts "*"+" "*(length+padding*2)+"*"
puts "*"*(length+padding*2+2)
end
|
#render_template(source) ⇒ Object
41
42
43
44
45
|
# File 'lib/bio-gem/mod/jeweler.rb', line 41
def render_template(source)
buf = original_render_template(source)
after_render_template(source,buf)
end
|
#target_dir ⇒ Object
Also known as:
github_repo_name
47
48
49
|
# File 'lib/bio-gem/mod/jeweler.rb', line 47
def target_dir
project_name.sub('bio','bioruby')
end
|