ryanb-nifty_generator 0.0.1 → 0.0.2

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.
File without changes
data/Manifest ADDED
@@ -0,0 +1,13 @@
1
+ lib/nifty_generator.rb
2
+ LICENSE
3
+ Manifest
4
+ nifty_generator.gemspec
5
+ rails_generators/nifty_layout/nifty_layout_generator.rb
6
+ rails_generators/nifty_layout/templates/layout.html.erb
7
+ rails_generators/nifty_layout/templates/stylesheet.css
8
+ rails_generators/nifty_layout/USAGE
9
+ README
10
+ test/test_generator_helper.rb
11
+ test/test_helper.rb
12
+ test/test_nifty_generator.rb
13
+ test/test_nifty_layout_generator.rb
File without changes
@@ -1,6 +1,5 @@
1
- $:.unshift(File.dirname(__FILE__)) unless
2
- $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
1
+ $:.unshift File.dirname(__FILE__)
3
2
 
4
3
  module NiftyGenerator
5
-
4
+ # not sure if I even need this...
6
5
  end
@@ -0,0 +1,49 @@
1
+
2
+ # Gem::Specification for Nifty_generator-0.0.2
3
+ # Originally generated by Echoe
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = %q{nifty_generator}
7
+ s.version = "0.0.2"
8
+
9
+ s.specification_version = 2 if s.respond_to? :specification_version=
10
+
11
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
+ s.authors = ["Ryan Bates"]
13
+ s.date = %q{2008-05-06}
14
+ s.description = %q{A collection of Ryan's generator scripts for Rails.}
15
+ s.email = %q{ryan@railscasts.com}
16
+ s.extra_rdoc_files = ["lib/nifty_generator.rb", "LICENSE", "README"]
17
+ s.files = ["lib/nifty_generator.rb", "LICENSE", "Manifest", "nifty_generator.gemspec", "rails_generators/nifty_layout/nifty_layout_generator.rb", "rails_generators/nifty_layout/templates/layout.html.erb", "rails_generators/nifty_layout/templates/stylesheet.css", "rails_generators/nifty_layout/USAGE", "README", "test/test_generator_helper.rb", "test/test_helper.rb", "test/test_nifty_generator.rb", "test/test_nifty_layout_generator.rb"]
18
+ s.has_rdoc = true
19
+ s.homepage = %q{http://github.com/ryanb/nifty_generator}
20
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Nifty_generator", "--main", "README"]
21
+ s.require_paths = ["lib"]
22
+ s.rubyforge_project = %q{nifty_generator}
23
+ s.rubygems_version = %q{1.0.0}
24
+ s.summary = %q{A collection of Ryan's generator scripts for Rails.}
25
+ s.test_files = ["test/test_generator_helper.rb", "test/test_helper.rb", "test/test_nifty_generator.rb", "test/test_nifty_layout_generator.rb"]
26
+ end
27
+
28
+
29
+ # # Original Rakefile source (requires the Echoe gem):
30
+ #
31
+ # require 'rubygems'
32
+ # require 'rake'
33
+ #
34
+ # begin
35
+ # require 'echoe'
36
+ #
37
+ # Echoe.new('nifty_generator', '0.0.2') do |p|
38
+ # p.summary = "A collection of Ryan's generator scripts for Rails."
39
+ # p.description = "A collection of Ryan's generator scripts for Rails."
40
+ # p.url = "http://github.com/ryanb/nifty_generator"
41
+ # p.author = 'Ryan Bates'
42
+ # p.email = "ryan@railscasts.com"
43
+ # p.ignore_pattern = ["script/*"]
44
+ # end
45
+ #
46
+ # rescue LoadError => boom
47
+ # puts "You are missing a dependency required for meta-operations on this gem."
48
+ # puts "#{boom.to_s.capitalize}."
49
+ # end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ryanb-nifty_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Bates
@@ -14,64 +14,39 @@ default_executable:
14
14
  dependencies: []
15
15
 
16
16
  description: A collection of Ryan's generator scripts for Rails.
17
- email:
18
- - ryan@railscasts.com
17
+ email: ryan@railscasts.com
19
18
  executables: []
20
19
 
21
20
  extensions: []
22
21
 
23
22
  extra_rdoc_files:
24
- - History.txt
25
- - License.txt
26
- - Manifest.txt
27
- - PostInstall.txt
28
- - README.txt
29
- - website/index.txt
23
+ - lib/nifty_generator.rb
24
+ - LICENSE
25
+ - README
30
26
  files:
31
- - History.txt
32
- - License.txt
33
- - Manifest.txt
34
- - PostInstall.txt
35
- - README.txt
36
- - Rakefile
37
- - config/hoe.rb
38
- - config/requirements.rb
39
27
  - lib/nifty_generator.rb
40
- - lib/nifty_generator/version.rb
41
- - rails_generators/nifty_layout/USAGE
28
+ - LICENSE
29
+ - Manifest
30
+ - nifty_generator.gemspec
42
31
  - rails_generators/nifty_layout/nifty_layout_generator.rb
43
32
  - rails_generators/nifty_layout/templates/layout.html.erb
44
33
  - rails_generators/nifty_layout/templates/stylesheet.css
45
- - script/console
46
- - script/destroy
47
- - script/generate
48
- - script/txt2html
49
- - setup.rb
50
- - tasks/deployment.rake
51
- - tasks/environment.rake
52
- - tasks/website.rake
34
+ - rails_generators/nifty_layout/USAGE
35
+ - README
53
36
  - test/test_generator_helper.rb
54
37
  - test/test_helper.rb
55
38
  - test/test_nifty_generator.rb
56
39
  - test/test_nifty_layout_generator.rb
57
- - website/index.html
58
- - website/index.txt
59
- - website/javascripts/rounded_corners_lite.inc.js
60
- - website/stylesheets/screen.css
61
- - website/template.html.erb
62
40
  has_rdoc: true
63
- homepage: http://github.com/ryanb/nifty_generator/
64
- post_install_message: |+
65
-
66
- For more information on nifty_generator, see http://github.com/ryanb/nifty_generator/
67
-
68
- NOTE: Change this information in PostInstall.txt
69
- You can also delete it if you don't want it.
70
-
71
-
41
+ homepage: http://github.com/ryanb/nifty_generator
42
+ post_install_message:
72
43
  rdoc_options:
44
+ - --line-numbers
45
+ - --inline-source
46
+ - --title
47
+ - Nifty_generator
73
48
  - --main
74
- - README.txt
49
+ - README
75
50
  require_paths:
76
51
  - lib
77
52
  required_ruby_version: !ruby/object:Gem::Requirement
data/History.txt DELETED
@@ -1,4 +0,0 @@
1
- == 0.0.1 2008-05-05
2
-
3
- * 1 major enhancement:
4
- * Initial release
data/Manifest.txt DELETED
@@ -1,31 +0,0 @@
1
- History.txt
2
- License.txt
3
- Manifest.txt
4
- PostInstall.txt
5
- README.txt
6
- Rakefile
7
- config/hoe.rb
8
- config/requirements.rb
9
- lib/nifty_generator.rb
10
- lib/nifty_generator/version.rb
11
- rails_generators/nifty_layout/USAGE
12
- rails_generators/nifty_layout/nifty_layout_generator.rb
13
- rails_generators/nifty_layout/templates/layout.html.erb
14
- rails_generators/nifty_layout/templates/stylesheet.css
15
- script/console
16
- script/destroy
17
- script/generate
18
- script/txt2html
19
- setup.rb
20
- tasks/deployment.rake
21
- tasks/environment.rake
22
- tasks/website.rake
23
- test/test_generator_helper.rb
24
- test/test_helper.rb
25
- test/test_nifty_generator.rb
26
- test/test_nifty_layout_generator.rb
27
- website/index.html
28
- website/index.txt
29
- website/javascripts/rounded_corners_lite.inc.js
30
- website/stylesheets/screen.css
31
- website/template.html.erb
data/PostInstall.txt DELETED
@@ -1,7 +0,0 @@
1
-
2
- For more information on nifty_generator, see http://github.com/ryanb/nifty_generator/
3
-
4
- NOTE: Change this information in PostInstall.txt
5
- You can also delete it if you don't want it.
6
-
7
-
data/Rakefile DELETED
@@ -1,4 +0,0 @@
1
- require 'config/requirements'
2
- require 'config/hoe' # setup Hoe + all gem configuration
3
-
4
- Dir['tasks/**/*.rake'].each { |rake| load rake }
data/config/hoe.rb DELETED
@@ -1,73 +0,0 @@
1
- require 'nifty_generator/version'
2
-
3
- AUTHOR = 'Ryan Bates' # can also be an array of Authors
4
- EMAIL = "ryan@railscasts.com"
5
- DESCRIPTION = "A collection of Ryan's generator scripts for Rails."
6
- GEM_NAME = 'nifty_generator' # what ppl will type to install your gem
7
- RUBYFORGE_PROJECT = 'nifty_generator' # The unix name for your project
8
- HOMEPATH = "http://github.com/ryanb/nifty_generator/"
9
- DOWNLOAD_PATH = "http://github.com/ryanb/nifty_generator/"
10
- EXTRA_DEPENDENCIES = [
11
- # ['activesupport', '>= 1.3.1']
12
- ] # An array of rubygem dependencies [name, version]
13
-
14
- @config_file = "~/.rubyforge/user-config.yml"
15
- @config = nil
16
- RUBYFORGE_USERNAME = "unknown"
17
- def rubyforge_username
18
- unless @config
19
- begin
20
- @config = YAML.load(File.read(File.expand_path(@config_file)))
21
- rescue
22
- puts <<-EOS
23
- ERROR: No rubyforge config file found: #{@config_file}
24
- Run 'rubyforge setup' to prepare your env for access to Rubyforge
25
- - See http://newgem.rubyforge.org/rubyforge.html for more details
26
- EOS
27
- exit
28
- end
29
- end
30
- RUBYFORGE_USERNAME.replace @config["username"]
31
- end
32
-
33
-
34
- REV = nil
35
- # UNCOMMENT IF REQUIRED:
36
- # REV = YAML.load(`svn info`)['Revision']
37
- VERS = NiftyGenerator::VERSION::STRING + (REV ? ".#{REV}" : "")
38
- RDOC_OPTS = ['--quiet', '--title', 'nifty_generator documentation',
39
- "--opname", "index.html",
40
- "--line-numbers",
41
- "--main", "README",
42
- "--inline-source"]
43
-
44
- class Hoe
45
- def extra_deps
46
- @extra_deps.reject! { |x| Array(x).first == 'hoe' }
47
- @extra_deps
48
- end
49
- end
50
-
51
- # Generate all the Rake tasks
52
- # Run 'rake -T' to see list of generated tasks (from gem root directory)
53
- $hoe = Hoe.new(GEM_NAME, VERS) do |p|
54
- p.developer(AUTHOR, EMAIL)
55
- p.description = DESCRIPTION
56
- p.summary = DESCRIPTION
57
- p.url = HOMEPATH
58
- p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
59
- p.test_globs = ["test/**/test_*.rb"]
60
- p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store'] #An array of file patterns to delete on clean.
61
-
62
- # == Optional
63
- p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
64
- #p.extra_deps = EXTRA_DEPENDENCIES
65
-
66
- #p.spec_extras = {} # A hash of extra values to set in the gemspec.
67
- end
68
-
69
- CHANGES = $hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
70
- PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}/#{GEM_NAME}"
71
- $hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
72
- $hoe.rsync_args = '-av --delete --ignore-errors'
73
- $hoe.spec.post_install_message = File.open(File.dirname(__FILE__) + "/../PostInstall.txt").read rescue ""
@@ -1,15 +0,0 @@
1
- require 'fileutils'
2
- include FileUtils
3
-
4
- require 'rubygems'
5
- %w[rake hoe newgem rubigen].each do |req_gem|
6
- begin
7
- require req_gem
8
- rescue LoadError
9
- puts "This Rakefile requires the '#{req_gem}' RubyGem."
10
- puts "Installation: gem install #{req_gem} -y"
11
- exit
12
- end
13
- end
14
-
15
- $:.unshift(File.join(File.dirname(__FILE__), %w[.. lib]))
@@ -1,9 +0,0 @@
1
- module NiftyGenerator #:nodoc:
2
- module VERSION #:nodoc:
3
- MAJOR = 0
4
- MINOR = 0
5
- TINY = 1
6
-
7
- STRING = [MAJOR, MINOR, TINY].join('.')
8
- end
9
- end
data/script/console DELETED
@@ -1,10 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # File: script/console
3
- irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
4
-
5
- libs = " -r irb/completion"
6
- # Perhaps use a console_lib to store any extra methods I may want available in the cosole
7
- # libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
8
- libs << " -r #{File.dirname(__FILE__) + '/../lib/nifty_generator.rb'}"
9
- puts "Loading nifty_generator gem"
10
- exec "#{irb} #{libs} --simple-prompt"
data/script/destroy DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
- APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
3
-
4
- begin
5
- require 'rubigen'
6
- rescue LoadError
7
- require 'rubygems'
8
- require 'rubigen'
9
- end
10
- require 'rubigen/scripts/destroy'
11
-
12
- ARGV.shift if ['--help', '-h'].include?(ARGV[0])
13
- RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
14
- RubiGen::Scripts::Destroy.new.run(ARGV)
data/script/generate DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
- APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
3
-
4
- begin
5
- require 'rubigen'
6
- rescue LoadError
7
- require 'rubygems'
8
- require 'rubigen'
9
- end
10
- require 'rubigen/scripts/generate'
11
-
12
- ARGV.shift if ['--help', '-h'].include?(ARGV[0])
13
- RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
14
- RubiGen::Scripts::Generate.new.run(ARGV)
data/script/txt2html DELETED
@@ -1,82 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- GEM_NAME = 'nifty_generator' # what ppl will type to install your gem
4
- RUBYFORGE_PROJECT = 'nifty_generator'
5
-
6
- require 'rubygems'
7
- begin
8
- require 'newgem'
9
- require 'rubyforge'
10
- rescue LoadError
11
- puts "\n\nGenerating the website requires the newgem RubyGem"
12
- puts "Install: gem install newgem\n\n"
13
- exit(1)
14
- end
15
- require 'redcloth'
16
- require 'syntax/convertors/html'
17
- require 'erb'
18
- require File.dirname(__FILE__) + "/../lib/#{GEM_NAME}/version.rb"
19
-
20
- version = NiftyGenerator::VERSION::STRING
21
- download = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
22
-
23
- def rubyforge_project_id
24
- RubyForge.new.autoconfig["group_ids"][RUBYFORGE_PROJECT]
25
- end
26
-
27
- class Fixnum
28
- def ordinal
29
- # teens
30
- return 'th' if (10..19).include?(self % 100)
31
- # others
32
- case self % 10
33
- when 1: return 'st'
34
- when 2: return 'nd'
35
- when 3: return 'rd'
36
- else return 'th'
37
- end
38
- end
39
- end
40
-
41
- class Time
42
- def pretty
43
- return "#{mday}#{mday.ordinal} #{strftime('%B')} #{year}"
44
- end
45
- end
46
-
47
- def convert_syntax(syntax, source)
48
- return Syntax::Convertors::HTML.for_syntax(syntax).convert(source).gsub(%r!^<pre>|</pre>$!,'')
49
- end
50
-
51
- if ARGV.length >= 1
52
- src, template = ARGV
53
- template ||= File.join(File.dirname(__FILE__), '/../website/template.html.erb')
54
- else
55
- puts("Usage: #{File.split($0).last} source.txt [template.html.erb] > output.html")
56
- exit!
57
- end
58
-
59
- template = ERB.new(File.open(template).read)
60
-
61
- title = nil
62
- body = nil
63
- File.open(src) do |fsrc|
64
- title_text = fsrc.readline
65
- body_text_template = fsrc.read
66
- body_text = ERB.new(body_text_template).result(binding)
67
- syntax_items = []
68
- body_text.gsub!(%r!<(pre|code)[^>]*?syntax=['"]([^'"]+)[^>]*>(.*?)</\1>!m){
69
- ident = syntax_items.length
70
- element, syntax, source = $1, $2, $3
71
- syntax_items << "<#{element} class='syntax'>#{convert_syntax(syntax, source)}</#{element}>"
72
- "syntax-temp-#{ident}"
73
- }
74
- title = RedCloth.new(title_text).to_html.gsub(%r!<.*?>!,'').strip
75
- body = RedCloth.new(body_text).to_html
76
- body.gsub!(%r!(?:<pre><code>)?syntax-temp-(\d+)(?:</code></pre>)?!){ syntax_items[$1.to_i] }
77
- end
78
- stat = File.stat(src)
79
- created = stat.ctime
80
- modified = stat.mtime
81
-
82
- $stdout << template.result(binding)