template_builder 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/History.txt CHANGED
@@ -1,4 +1,7 @@
1
- == 1.0.0 / 2010-11-21
1
+
2
+ == 0.2.0 / 2010-12-21
3
+ * show action
4
+ == 0.1.0 / 2010-11-21
2
5
 
3
6
  * 1 major enhancement
4
7
  * Birthday!
data/README.txt CHANGED
@@ -4,16 +4,20 @@ template_builder
4
4
 
5
5
  == DESCRIPTION:
6
6
 
7
- Generate a template for your ruby on rails project
7
+ Template-builder is a handy tool that builds a template for your new Ruby
8
+ on Rails projects. The template contains all you need to build the RoR
9
+ project that you want.
8
10
 
9
- == FEATURES/PROBLEMS:
10
-
11
-
12
- == SYNOPSIS:
11
+ == USAGE:
13
12
 
14
- template_builder foo
13
+ template_builder -h/--help
14
+ template_builder -v/--version
15
+ template_builder [command] [parameter type parameter type] [options]
16
+
17
+ == EXAMPLES:
15
18
 
16
- == REQUIREMENTS:
19
+ template_builder new your_template
20
+ template_builder show
17
21
 
18
22
 
19
23
  == INSTALL:
@@ -77,7 +77,7 @@ class Command
77
77
  opts.on(*parameter)
78
78
  when String
79
79
  opts.separator(" #{parameter.strip}")
80
- else opts.separator('') end
80
+ else puts parameter;opts.separator('') end
81
81
  }
82
82
  opts.separator ''
83
83
  end
@@ -39,7 +39,7 @@ module TemplateBuilder::App::FileAnalyzer
39
39
 
40
40
  def analyse_file
41
41
  @config_file.each{ |k,v| @parameters[k.to_sym] = ["-#{k[0..0].to_s}", "--#{k} FRAMEWORK", "#{v['help'].capitalize} .",
42
- lambda { |item| @config_param[k.to_sym] = Parameter.new :priority=>0,:name=>item }] }
42
+ lambda { |item| @config_param[k.to_sym] = TemplateBuilder::App::Helper::Parameter.new :priority=>0,:name=>item }] }
43
43
  end
44
44
 
45
45
  def load_conf_file
@@ -28,10 +28,28 @@ class Framework
28
28
  @action.each { |act| ret << act if act}
29
29
  ret
30
30
  end
31
+
32
+ def to_s
33
+ msg = @name+"\n"
34
+ msg += "\tAll gems for this plugin : \n"
35
+ @gems.each do |gem|
36
+ msg +="\t\tname => #{gem.name}\n"
37
+ msg +="\t\t\t-source => #{gem.source}\n"
38
+ msg +="\t\t\t-version => #{gem.version}\n"
39
+ msg +="\t\t\t-action => #{gem.action}\n"
40
+ end
41
+ msg +="\n"
42
+ msg += "\tcommand => #{@command}\n"
43
+ msg +="\n"
44
+ msg += "\tAll actions for this plugin : \n"
45
+ @action.each { |act| msg+="\taction => #{act.to_s}\n"}
46
+ msg
47
+ end
48
+
31
49
  end
32
50
 
33
51
  class Gem
34
- attr_reader :action
52
+ attr_reader :action, :version, :source, :name
35
53
  def initialize(opts = {})
36
54
  @version = opts[:version]
37
55
  @source = opts[:source]
@@ -14,27 +14,18 @@ and for each type, can show you a description of all plugin available
14
14
  parameter(item.to_s)
15
15
  }
16
16
  option(standard_options[:verbose])
17
- option(standard_options[:force])
18
17
  end
19
18
 
20
19
  def run
21
- # raise Error, "File #{name} doesn't exists." if !force and !test ?e, name
22
- # file_manager = FileManager.new(
23
- # :file => name,
24
- # :stdout => stdout,
25
- # :stderr => stderr,
26
- # :verbose => verbose?
27
- # )
28
- # announce
29
- # sorted_param = @config_param.sort{|a,b| a[1].priority <=> b[1].priority }.map
30
- # sorted_param.each{ |k,v| ask_for k unless v.name }
31
- #
32
- # file_manager.start_file sorted_param
33
- #
34
- # sorted_param.each{ |k,v| run_framework file_manager, :type=>k, :name=>v.name unless v.name == "none"}
35
- #
36
- # file_manager.end_file name, @command
37
-
20
+ type = @param.shift
21
+ array = FileAnalyzer.all_frameworks_for(type)
22
+ if @param.length == 0
23
+ annouce array
24
+ else
25
+ plugin = @param.shift
26
+ framework = FileAnalyzer.load_framework :type=>type, :name=>plugin
27
+ puts framework.to_s
28
+ end
38
29
  end
39
30
 
40
31
  def parse( args )
@@ -44,15 +35,15 @@ and for each type, can show you a description of all plugin available
44
35
  stdout.puts opts
45
36
  exit 1
46
37
  end
38
+ @param = opts.parse! args
47
39
  end
48
-
49
- def announce
50
- complete_name = name.split("/")
51
- file = complete_name.last
52
- output_dir = complete_name[0..complete_name.length-2]
53
- msg = "Editing '#{file}'"
54
- msg << " in directory '#{output_dir}'" if name.to_s != output_dir.to_s
55
- stdout.puts msg
40
+
41
+ def annouce(array)
42
+ msg = "All frameworks available are : \n"
43
+ array.each { |item| msg += "\t#{item}\n"}
44
+ msg += "\n"
45
+ msg += "You can show detail of one plugin by running :\n template_builder show framework plugin"
46
+ puts msg
56
47
  end
57
48
  end
58
49
  end
data/version.txt CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.2.0
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: template_builder
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 1
8
+ - 2
9
9
  - 0
10
- version: 0.1.0
10
+ version: 0.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Anthony
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-12-20 00:00:00 +01:00
18
+ date: 2010-12-21 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -34,7 +34,10 @@ dependencies:
34
34
  version: 3.5.1
35
35
  type: :development
36
36
  version_requirements: *id001
37
- description: Generate a template for your ruby on rails project
37
+ description: |-
38
+ Template-builder is a handy tool that builds a template for your new Ruby
39
+ on Rails projects. The template contains all you need to build the RoR
40
+ project that you want.
38
41
  email: anthony.laibe@gmail.com
39
42
  executables:
40
43
  - template_builder
@@ -69,7 +72,6 @@ files:
69
72
  - lib/template_builder/app/new.rb
70
73
  - lib/template_builder/app/show.rb
71
74
  - version.txt
72
- - test/test_template_builder.rb
73
75
  has_rdoc: true
74
76
  homepage: https://github.com/alaibe/template_builder
75
77
  licenses: []
@@ -104,6 +106,6 @@ rubyforge_project: template_builder
104
106
  rubygems_version: 1.3.7
105
107
  signing_key:
106
108
  specification_version: 3
107
- summary: Generate a template for your ruby on rails project
108
- test_files:
109
- - test/test_template_builder.rb
109
+ summary: Template-builder is a handy tool that builds a template for your new Ruby on Rails projects
110
+ test_files: []
111
+
File without changes