startups 0.0.3.2 → 0.0.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (8) hide show
  1. data/CHANGELOG +30 -0
  2. data/LICENSE +20 -0
  3. data/README +30 -0
  4. data/Rakefile +16 -0
  5. data/TODO +5 -0
  6. data/lib/startups.rb +80 -0
  7. data/startups.gemspec +32 -0
  8. metadata +12 -6
data/CHANGELOG ADDED
@@ -0,0 +1,30 @@
1
+ 0.0.0 (Aug 13th, 2009)
2
+
3
+ * just getting started. Added the nav startup.
4
+
5
+ 0.0.1 (Oct 16th, 2009)
6
+
7
+ * Added the content and layout startups.
8
+ * Tweaked all the startups to play nice.
9
+ * Added better wireframe styles
10
+ * Added examples.
11
+ * Generating all 3 startups will get you a working example with 3 pages.
12
+
13
+ 0.0.2 (Oct 16th, 2009)
14
+
15
+ * Added better wireframe styles
16
+ * changed the examples so that not all nav items appear in the footer and header
17
+ * added a 'startup' generator that runs them all at once.
18
+ * added support to the generator commands for removing a file and running a separate generator.
19
+ * fixed the destroy for custom route generator command to properly remove generated routes.
20
+ * Tweaked all the startups to play nice.
21
+ * Added examples.
22
+ * Running a single generator (startup) now generates all 3 startups and gets you a working example with 3 pages.
23
+
24
+ 0.0.2.1 (Oct 19th, 2009)
25
+
26
+ * Cleaned up and streamlined some things.
27
+
28
+ 0.0.3 (Jun 9th, 2010)
29
+
30
+ * Added in CSS/Layout basics from InfoEther Framework
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Ryan Owens
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README ADDED
@@ -0,0 +1,30 @@
1
+ = search_scope
2
+
3
+ Rails gem with collection of Rails "startups" for features such as navigation and forms with customizable error handling.
4
+
5
+ == Install
6
+
7
+ gem install startups
8
+
9
+ == Usage
10
+
11
+ After installing the gem, you can use the startup generators in your Rails app.
12
+
13
+ From your rails app's root directory, type:
14
+ script/generate startup_nav
15
+
16
+ #TODO script/destroy should also work?
17
+
18
+ == Included Generators
19
+
20
+ * startup_layout: Generates the base files for any standard app and some basic no design styles
21
+ * startup_nav: generates the files needed for a simple, easily styled navigation.
22
+ * startup_content: generated a content controller for home and other non-rest pages. A basic layout and stylesheet is also provided.
23
+
24
+ * COMING SOON: startup_form: generates the files needed for generic forms with customizable error handling.
25
+ ** updating this to use formatastic
26
+
27
+ For more information, run:
28
+ script/generate startup_nav --help
29
+
30
+
data/Rakefile ADDED
@@ -0,0 +1,16 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+ require 'echoe'
4
+
5
+ Echoe.new('startups', '0.0.2.1') do |p|
6
+ p.project = "startups"
7
+ p.description = "A collection of Rails \"startups\" for features such as a standard layout, navigation and forms with customizable error handling."
8
+ p.url = "http://rubyforge.org/projects/startups"
9
+ p.author = 'Ryan Owens'
10
+ p.email = "ryan (at) infoether (dot) com"
11
+ p.ignore_pattern = ["tmp/*", "script/*", "startups_notes.txt", "*.tmproj"]
12
+ p.development_dependencies = []
13
+ end
14
+
15
+ Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
16
+
data/TODO ADDED
@@ -0,0 +1,5 @@
1
+
2
+ #TODO make script/destroy work
3
+
4
+ #TODO add form generator
5
+
data/lib/startups.rb ADDED
@@ -0,0 +1,80 @@
1
+ module Startups
2
+ # look under rails_generators for the meat
3
+ end
4
+
5
+ #TODO put this somewhere else, or figure out a better way to do it so I don't have to copy it for other generators.
6
+ #modified from: http://patshaughnessy.net/2009/9/2/rails-generator-tutorial-part-2-writing-a-custom-manifest-action
7
+ module Rails
8
+ module Generator
9
+ module Commands
10
+
11
+ class Base
12
+ def route_code(route_options)
13
+ if route_options.is_a? Hash
14
+ "map.#{route_options[:name]} '#{route_options[:name]}', :controller => '#{route_options[:controller]}', :action => '#{route_options[:action]}'"
15
+ else
16
+ route_options.to_s.gsub("\n ","\n").strip
17
+ end
18
+ end
19
+ def route_code_log_message(route_options)
20
+ code = route_code(route_options)
21
+ if code.index "\n"
22
+ code = code[0,code.index("\n")]
23
+ code = "#{code} ... end" if code.index ' do '
24
+ end
25
+ code
26
+ end
27
+ end
28
+
29
+ # Here's a readable version of the long string used above in route_code;
30
+ # but it should be kept on one line to avoid inserting extra whitespace
31
+ # into routes.rb when the generator is run:
32
+ # "map.#{route_options[:name]} '#{route_options[:name]}',
33
+ # :controller => '#{route_options[:controller]}',
34
+ # :action => '#{route_options[:action]}'"
35
+
36
+ class Create
37
+ def route(route_options)
38
+ sentinel = 'ActionController::Routing::Routes.draw do |map|'
39
+ logger.route route_code_log_message(route_options)
40
+ #TODO add something here to prevent duplicating the route. Like file_contains? or something.
41
+ gsub_file 'config/routes.rb', /(#{Regexp.escape(sentinel)})/mi do |m|
42
+ "#{m}\n #{route_code(route_options)}\n"
43
+ end
44
+ end
45
+
46
+ def generate(name)
47
+ logger.generate "running additional generator: #{name}"
48
+ Rails::Generator::Scripts::Generate.new.run([name])
49
+ end
50
+
51
+ def rm(relative_destination)
52
+ destination = destination_path('public/index.html')
53
+ if File.exist?(destination)
54
+ logger.rm relative_destination
55
+ FileUtils.rm(destination)
56
+ end
57
+ end
58
+ end
59
+
60
+ class Destroy
61
+ def route(route_options)
62
+ logger.remove_route route_code_log_message(route_options)
63
+ # to_remove = "\n #{route_code(route_options)}"
64
+ to_remove = "\n #{route_code(route_options)}\n"
65
+ gsub_file 'config/routes.rb', to_remove, ''
66
+ end
67
+
68
+ def generate(name)
69
+ logger.destroy "rewinding additional generator: #{name}"
70
+ Rails::Generator::Scripts::Destroy.new.run([name])
71
+ end
72
+
73
+ def rm(relative_destination)
74
+ logger.gone "can't replace rm'd file: #{relative_destination}"
75
+ end
76
+ end
77
+
78
+ end
79
+ end
80
+ end
data/startups.gemspec ADDED
@@ -0,0 +1,32 @@
1
+ Gem::Specification.new do |s|
2
+ s.platform = Gem::Platform::RUBY
3
+ s.name = 'startups'
4
+ s.version = '0.0.3.3'
5
+ s.summary = 'Rails Generators from InfoEther'
6
+ s.description = 'Rails generators for basic infoether apps including file setup, base working styles, and more.'
7
+
8
+ s.authors = ['Ryan Owens','John Athayde']
9
+ s.email = ['ryan@infoether.com','john@infoether.com']
10
+ s.homepage = 'http://www.infoether.com'
11
+
12
+ s.add_dependency('rails', '>=2.3.4')
13
+
14
+ s.files = [
15
+ "CHANGELOG",
16
+ "lib/startups.rb",
17
+ "LICENSE",
18
+ "Rakefile",
19
+ "README",
20
+ "startups.gemspec",
21
+ "TODO"
22
+ ]
23
+ s.files.concat Dir.glob("rails_generators/*")
24
+
25
+ s.post_install_message = %q{
26
+ ================================================================================
27
+ Thanks for installing InfoEther's startups gem. Thi sis under heavy development
28
+ to match our current working setup and project templates. Let us know what you
29
+ think! - Ryan & John
30
+ ================================================================================
31
+ }
32
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: startups
3
3
  version: !ruby/object:Gem::Version
4
- hash: 71
4
+ hash: 69
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
9
  - 3
10
- - 2
11
- version: 0.0.3.2
10
+ - 3
11
+ version: 0.0.3.3
12
12
  platform: ruby
13
13
  authors:
14
14
  - Ryan Owens
@@ -46,13 +46,19 @@ extensions: []
46
46
 
47
47
  extra_rdoc_files: []
48
48
 
49
- files: []
50
-
49
+ files:
50
+ - CHANGELOG
51
+ - lib/startups.rb
52
+ - LICENSE
53
+ - Rakefile
54
+ - README
55
+ - startups.gemspec
56
+ - TODO
51
57
  has_rdoc: true
52
58
  homepage: http://www.infoether.com
53
59
  licenses: []
54
60
 
55
- post_install_message:
61
+ post_install_message: "\n ================================================================================\n Thanks for installing InfoEther's startups gem. Thi sis under heavy development\n to match our current working setup and project templates. Let us know what you\n think! - Ryan & John\n ================================================================================\n "
56
62
  rdoc_options: []
57
63
 
58
64
  require_paths: