sinatra_more 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -45,13 +45,13 @@ of tools, helpers and components that will make Sinatra suitable for more comple
45
45
 
46
46
  Here is a small list of what sinatra_more contains:
47
47
 
48
+ * Code generators for creating new sinatra applications (using <tt>sinatra_gen</tt> on command line)
48
49
  * Generic view and tag helpers (<tt>tag</tt>, <tt>content_tag</tt>, <tt>input_tag</tt>, ...)
49
50
  * Asset tag helpers (<tt>link_to</tt>, <tt>image_tag</tt>, <tt>javascript_include_tag</tt>, ...)
50
51
  * Full form helpers and builders support (<tt>form_tag</tt>, <tt>form_for</tt>, <tt>field_set_tag</tt>, <tt>text_field</tt>, ...)
51
52
  * Generally useful formatting extensions (<tt>relative_time_ago</tt>, <tt>js_escape_html</tt>, <tt>sanitize_html</tt>)
52
53
  * Simple 'mailer' support for sinatra (akin to <tt>ActionMailer</tt> but simpler and powered by <tt>pony</tt>)
53
54
  * Plug and play setup for the excellent Warden authentication system
54
- * Code generators for creating new sinatra applications (COMING SOON)
55
55
 
56
56
  Keep in mind, the user will be able to pull in these components seperately and leave out those that are not required.
57
57
 
@@ -347,6 +347,8 @@ I hope to create or merge in an even better 'default' form_builder in the near f
347
347
  * Escapes html to allow passing information to javascript. Used for passing data inside an ajax .js.erb template
348
348
  * <tt>escape_javascript("<h1>Hey</h1>")</tt>
349
349
 
350
+ See the wiki article for additional information: <http://wiki.github.com/nesquena/sinatra_more/markupplugin>
351
+
350
352
  === RenderPlugin
351
353
 
352
354
  This component provides a number of rendering helpers for sinatra, making the process
@@ -398,6 +400,8 @@ This works as you would expect and also supports the collection counter inside t
398
400
 
399
401
  And that concludes the render plugin for now but I am open to adding more methods as time progresses.
400
402
 
403
+ See the wiki article for additional information: <http://wiki.github.com/nesquena/sinatra_more/renderplugin>
404
+
401
405
  === WardenPlugin
402
406
 
403
407
  This component provides out-of-the-box support for Warden authentication. With this
@@ -467,6 +471,8 @@ Eventually I plan to vendor that gem or just remove support for this piece of my
467
471
  If anybody has any thoughts on this or the warden integration in general, please let me know.
468
472
  Nonetheless, there is a certain convenience for me having access to a plug-and-play warden solution directly from this gem.
469
473
 
474
+ See the wiki article for additional information: <http://wiki.github.com/nesquena/sinatra_more/wardenplugin>
475
+
470
476
  === MailerPlugin
471
477
 
472
478
  This component uses an enhanced version of the excellent <tt>pony</tt> library (vendored) for a powerful but simple
@@ -540,6 +546,8 @@ or perhaps we want to have a short body without the need for a template file:
540
546
  body "This is a short body defined right in the mailer itself"
541
547
  end
542
548
  end
549
+
550
+ See the wiki article for additional information: <http://wiki.github.com/nesquena/sinatra_more/mailerplugin>
543
551
 
544
552
  == Sinatra Generators
545
553
 
@@ -568,7 +576,7 @@ There is also support for aliases for each component within the command:
568
576
 
569
577
  The available components and their default options are listed below:
570
578
 
571
- * test: <tt>bacon</tt> (default), <tt>shoulda</tt>, <tt>rspec</tt>, <tt>testspec</tt>,<tt>riot</tt>
579
+ * test: <tt>bacon</tt> (default), <tt>shoulda</tt>, <tt>rspec</tt>, <tt>testspec</tt>, <tt>riot</tt>
572
580
  * renderer: <tt>erb</tt> (default), <tt>haml</tt>
573
581
  * mock: <tt>mocha</tt> (default), <tt>rr</tt>
574
582
  * script: <tt>jquery</tt> (default), <tt>prototype</tt>, <tt>rightjs</tt>
@@ -584,6 +592,8 @@ We are planning to add additional generator actions such as:
584
592
  * Model generator (working for any of the available orms listed)
585
593
  * Routes generator
586
594
  * Migrations generator
595
+
596
+ See the wiki article for additional information: <http://wiki.github.com/nesquena/sinatra_more/generator>
587
597
 
588
598
  == Acknowledgements
589
599
 
data/TODO CHANGED
@@ -1,20 +1,16 @@
1
1
  = UNFINISHED
2
2
 
3
+ * Add support for model, routes, migration generator types based on components
3
4
  * Add support for fields_for tag in formbuilder
4
5
  * Add support for button tag method, mail_to helper
5
6
  * Add support for check_box_group, radio_button_group which create a set of checkboxes or radio buttons
6
- * Look into creating sinatra generators using rubigen (http://github.com/drnic/rubigen)
7
- * http://github.com/quirkey/sinatra-gen
8
- * test generators
9
- * add support for model, routes, migration generator types
10
7
  * Become total warden solution (basically just require warden gem installed, do everything else)
11
8
  * Look into removing overlapping methods and simply leverage sinatra_warden
12
9
  * Take advantage of shared strategies: http://github.com/hassox/warden_strategies/tree/master/lib/
13
- * Make warden password strategy support a callback which explains what to do with username, password
14
- * WardenPlugin.authenticate_callback { |username, password| User.authenticate(username, password) }
15
10
 
16
11
  = COMPLETED
17
12
 
13
+ * Created application generator using thor
18
14
  * Add support for a MailerPlugin which will make sending emails a breeze (http://github.com/hiroshi/pony)
19
15
  * Add support for missing formbuilder fields (select, and standard_form_builder methods i.e check_box_group)
20
16
  * Add support for missing formhelpers/fields (radio_button_tag, select_tag)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.3.1
data/bin/sinatra_gen CHANGED
@@ -2,4 +2,5 @@
2
2
 
3
3
  %w[rubygems activesupport thor].each { |gem| require gem }
4
4
  require File.dirname(__FILE__) + "/../generators/skeleton_generator"
5
- SinatraMore::SkeletonGenerator.start
5
+ arguments = ARGV.any? ? ARGV : ['-h']
6
+ SinatraMore::SkeletonGenerator.start(arguments)
@@ -58,9 +58,10 @@ module SinatraMore
58
58
  # Defines a class option to allow a component to be chosen and add to component type list
59
59
  # Also builds the available_choices hash of which component choices are supported
60
60
  # component_option :test, "Testing framework", :aliases => '-t', :choices => [:bacon, :shoulda]
61
- def component_option(name, description, options = {})
61
+ def component_option(name, caption, options = {})
62
62
  (@available_choices ||= Hash.new({}))[name] = options[:choices]
63
- class_option name, :default => options[:choices].first, :aliases => options[:aliases]
63
+ description = "The #{caption} component (#{options[:choices].join(', ')})"
64
+ class_option name, :default => options[:choices].first, :aliases => options[:aliases], :desc => description
64
65
  end
65
66
 
66
67
  # Returns the compiled list of component types which can be specified
@@ -6,21 +6,24 @@ module SinatraMore
6
6
  class SkeletonGenerator < Thor::Group
7
7
  # Define the source template root
8
8
  def self.source_root; File.dirname(__FILE__); end
9
+ def self.banner; "sinatra_gen [app_name] [path] [options]"; end
9
10
 
10
11
  # Include related modules
11
12
  include Thor::Actions
12
13
  include SinatraMore::GeneratorActions
13
14
  include SinatraMore::ComponentActions
15
+
16
+ desc "Description:\n\n\tsinatra_gen is the sinatra_more generators which generate or build on Sinatra applications."
14
17
 
15
18
  argument :name, :desc => "The name of your sinatra app"
16
19
  argument :path, :desc => "The path to create your app"
17
20
 
18
21
  # Definitions for the available customizable components
19
- component_option :orm, "Database engine", :aliases => '-d', :choices => [:sequel, :datamapper, :mongomapper, :activerecord]
20
- component_option :test, "Testing framework", :aliases => '-t', :choices => [:bacon, :shoulda, :rspec, :testspec, :riot]
21
- component_option :mock, "Mocking library", :aliases => '-m', :choices => [:mocha, :rr]
22
- component_option :script, "Javascript library", :aliases => '-s', :choices => [:jquery, :prototype, :rightjs]
23
- component_option :renderer, "Template Engine", :aliases => '-r', :choices => [:erb, :haml]
22
+ component_option :orm, "database engine", :aliases => '-d', :choices => [:sequel, :datamapper, :mongomapper, :activerecord]
23
+ component_option :test, "testing framework", :aliases => '-t', :choices => [:bacon, :shoulda, :rspec, :testspec, :riot]
24
+ component_option :mock, "mocking library", :aliases => '-m', :choices => [:mocha, :rr]
25
+ component_option :script, "javascript library", :aliases => '-s', :choices => [:jquery, :prototype, :rightjs]
26
+ component_option :renderer, "template engine", :aliases => '-r', :choices => [:erb, :haml]
24
27
 
25
28
  # Copies over the base sinatra starting application
26
29
  def setup_skeleton
data/sinatra_more.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{sinatra_more}
8
- s.version = "0.3.0"
8
+ s.version = "0.3.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Nathan Esquenazi"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra_more
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Esquenazi