patcito-ricogen 0.3

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.
@@ -0,0 +1,27 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ HAML_GEMSPEC = Gem::Specification.new do |s|
5
+ s.name = 'patcito-ricogen'
6
+ s.rubyforge_project = 'ricogen'
7
+ s.summary = "My rails 3 app generator based on hamgen"
8
+ s.version = File.read('VERSION').strip
9
+ s.authors = ['Hampton Catlin', "David Cuadrado"]
10
+ s.email = 'krawek@gmail.com'
11
+ s.description = <<-END
12
+ A Rails 3.0 generator (like for the whole project) that pre-generates
13
+ a bunch of shit I like. Most of it is stolen directly from Hampton's Rails Template
14
+ at http://github.com/hcatlin/hamgen but with changes just for ole' me
15
+ END
16
+
17
+ s.add_runtime_dependency('colored', ['~> 1.2'])
18
+ s.add_runtime_dependency('rails', ['~> 3.0.0'])
19
+ s.add_runtime_dependency('haml', ['~> 3.0.18'])
20
+
21
+ s.add_development_dependency('rake', ['~> 0.8.7'])
22
+
23
+ s.executables = ['ricogen']
24
+ s.files = Dir['**/**'].to_a.select { |f| f[0..2] != "pkg"}
25
+ s.homepage = 'http://www.hamptoncatlin.com/'
26
+ end
27
+
data/ricogen-0.3.gem ADDED
Binary file
data/templates/Gemfile ADDED
@@ -0,0 +1,109 @@
1
+ # Edit this Gemfile to bundle your application's dependencies.
2
+ # This preamble is the current preamble for Rails 3 apps; edit as needed.
3
+ source 'http://rubygems.org'
4
+
5
+ gem 'rails', '3.0.10'
6
+
7
+ if RUBY_PLATFORM !~ /mswin|mingw/
8
+ gem 'rdiscount', '1.6.5'
9
+
10
+ gem "ruby-stemmer", "~> 0.8.2", :require => "lingua/stemmer"
11
+ gem "sanitize", "1.2.1"
12
+
13
+ gem 'magic'
14
+ gem 'mini_magick', '~> 2.3'
15
+ gem 'nokogiri'
16
+ gem 'mechanize'
17
+ else
18
+ gem "maruku", "0.6.0"
19
+ end
20
+
21
+ # ui
22
+ gem "haml"
23
+ gem "sass"
24
+ gem 'compass', '0.11.1'
25
+ gem "compass-colors", "0.9.0"
26
+ gem "fancy-buttons", "1.1.1"
27
+ gem 'kaminari'
28
+
29
+ # mongodb
30
+ gem 'bson', '1.3.0'
31
+ gem 'bson_ext', '1.3.0'
32
+
33
+ gem 'mongo', '1.3.0'
34
+ gem 'mongoid', :git => 'git://github.com/mongoid/mongoid.git', :ref => "eb41dd0e"
35
+ gem 'mongoid_ext', :git => "git://github.com/dcu/mongoid_ext.git"
36
+
37
+ gem 'mongo_store', :git => 'https://github.com/Houdini/mongo_store.git'
38
+
39
+ # utils
40
+
41
+ gem 'jammit'
42
+ gem "whatlanguage", "1.0.0"
43
+ gem "uuidtools", "~> 2.1.1"
44
+ gem "magent", "0.6.2"
45
+ gem "bug_hunter", :git => "git://github.com/ricodigo/bug_hunter.git"
46
+
47
+ gem 'goalie', '~> 0.0.4'
48
+ gem 'dynamic_form'
49
+
50
+ gem "rack-recaptcha", "0.2.2", :require => "rack/recaptcha"
51
+
52
+ gem "twitter-text", "1.1.8"
53
+ gem 'sanitize', '1.2.1'
54
+ gem "twitter_oauth"
55
+ gem 'social_widgets', :git => 'https://git.gitorious.org/social_widgets/social_widgets.git'
56
+ gem 'activemerchant', '1.16.0'
57
+ gem 'pdfkit', :git => 'git://github.com/jdpace/PDFKit.git' # apt-get install wkhtmltopdf
58
+
59
+ gem 'geoip'
60
+
61
+ # authentication
62
+ gem 'omniauth', '~> 0.2.6'
63
+ gem 'oa-openid', '~> 0.2.6', :require => 'omniauth/openid'
64
+ gem "oa-oauth", '~> 0.2.6', :require => "omniauth/oauth"
65
+
66
+ gem 'multiauth', :git => "http://github.com/dcu/multiauth.git"
67
+
68
+ gem 'orm_adapter'
69
+ gem 'devise', "~> 1.4.0"
70
+
71
+ gem 'whenever', :require => false
72
+ gem 'rack-ssl', :require => false
73
+
74
+ gem 'state_machine', "0.10.4"
75
+
76
+ group :deploy do
77
+ gem 'capistrano', :require => false
78
+ gem 'ricodigo-capistrano-recipes', "~> 0.1.3", :require => false
79
+ gem 'unicorn', '4.1.1', :require => false
80
+ end
81
+
82
+ group :scripts do
83
+ gem 'eventmachine', '~> 0.12.10'
84
+ gem 'em-websocket', '~> 0.3.0'
85
+ gem 'twitter', '1.5.0'
86
+ end
87
+
88
+ group :test do
89
+ gem 'machinist_mongo', :require => 'machinist/mongoid'
90
+ gem 'ffaker'
91
+ gem 'simplecov'
92
+ gem "autotest"
93
+ gem 'ruby-debug19', '0.11.6', :require => 'ruby-debug'
94
+ end
95
+
96
+ group :development do
97
+ gem "database_cleaner"
98
+ gem "rspec", ">= 2.0.1"
99
+ gem "rspec-rails", ">= 2.0.1"
100
+ gem "remarkable_mongoid", ">= 0.5.0"
101
+ gem 'hpricot'
102
+ gem 'ruby_parser'
103
+ gem 'mongrel', '1.2.0.pre2'
104
+ gem 'niftier-generators', '0.1.2'
105
+ gem 'ruby-prof'
106
+ gem 'tunnlr_connector', :git => "git://github.com/dcu/tunnlr_connector.git", :branch => "patch-1", :require => "tunnlr"
107
+ gem 'rails-dev-boost', :git => 'git://github.com/thedarkone/rails-dev-boost.git', :require => 'rails_development_boost'
108
+ end
109
+
@@ -0,0 +1,49 @@
1
+ require 'ostruct'
2
+
3
+ config_file = Rails.root+"config/app.yml"
4
+ options = YAML.load_file(config_file)
5
+ if !options[Rails.env]
6
+ raise "'#{Rails.env}' was not found in #{config_file}"
7
+ end
8
+ AppConfig = OpenStruct.new(options[Rails.env])
9
+
10
+
11
+ SANITIZE_CONFIG = {
12
+ :protocols => {
13
+ "a"=>{"href"=>["ftp", "http", "https", "mailto", :relative]},
14
+ "img"=>{"src"=>["http", "https", :relative]},
15
+ "blockquote"=>{"cite"=>["http", "https", :relative]},
16
+ "q"=>{"cite"=>["http", "https", :relative]}
17
+ },
18
+ :elements => ["a", "b", "blockquote", "br", "caption", "cite", "code", "col",
19
+ "colgroup", "dd", "dl", "dt", "em", "h1", "h2", "h3", "h4", "h5",
20
+ "h6", "i", "img", "li", "ol", "p", "pre", "q", "small", "strike",
21
+ "strong", "sub", "sup", "table", "tbody", "td", "tfoot", "th",
22
+ "thead", "tr", "u", "ul", "font", "s", "hr", "div", "span"],
23
+ :attributes => {
24
+ "div" => ["style"],
25
+ "pre" => ["style"],
26
+ "code" => ["style"],
27
+ "colgroup"=>["span", "width"],
28
+ "col"=>["span", "width"],
29
+ "ul"=>["type"],
30
+ "a"=>["href", "title"],
31
+ "img"=>["align", "alt", "height", "src", "title", "width"],
32
+ "blockquote"=>["cite"],
33
+ "td"=>["abbr", "axis", "colspan", "rowspan", "width"],
34
+ "table"=>["summary", "width"],
35
+ "q"=>["cite"],
36
+ "ol"=>["start", "type"],
37
+ "th"=>["abbr", "axis", "colspan", "rowspan", "scope", "width"]
38
+ }
39
+ }
40
+
41
+
42
+ Rails.application.config.session_store :cookie_store, :key => AppConfig.session_key, :domain => :all
43
+ Rails.application.config.secret_token = AppConfig.session_secret
44
+
45
+ ActionMailer::Base.default_url_options[:host] = AppConfig.domain
46
+
47
+ if File.exist?(Rails.root + "VERSION")
48
+ AppConfig.version = File.read(Rails.root + "VERSION")
49
+ end
@@ -0,0 +1,28 @@
1
+ !!!
2
+ %html{:lang => 'en'}
3
+ %head
4
+ %title #{@title}
5
+ %meta{:charset => 'utf-8'}
6
+ %meta{'http-equiv' => 'X-UA-Compatible', :content => 'IE=edge,chrome=1'}
7
+ %meta{:name => 'viewport', :content => 'width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0'}
8
+ = csrf_meta_tag
9
+ <!--[if ! lte IE 7]><!-->
10
+ %link{:rel => 'stylesheet', :href => '/stylesheets/application.css'}
11
+ <!--<![endif]-->
12
+ /[if lte IE 7]
13
+ %link{:rel => 'stylesheet', :href => 'http://universal-ie6-css.googlecode.com/files/ie6.0.3.css'}
14
+ /[if IE]
15
+ %script{:src => 'http://html5shiv.googlecode.com/svn/trunk/html5.js'}
16
+
17
+ %body{:class => page_class}
18
+ = yield
19
+
20
+ <!--[if ! lte IE 7]><!-->
21
+ %script{:src => 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'}
22
+ %script{:src => '/javascripts/application.js'}
23
+ <!--<![endif]-->
24
+ /[if lte IE 8]
25
+ //%script{:src => 'http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js'}
26
+
27
+ / Google Analytics | Don't forget to include your tracking number!!!!
28
+ %script var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-XXXXX-X']); _gaq.push(['_trackPageview']); (function() {var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);})();
@@ -0,0 +1,8 @@
1
+ config.generators do |g|
2
+ g.orm = :mongoid
3
+ g.template_engine = :haml
4
+ g.test_framework = :rspec
5
+ end
6
+
7
+ config.middleware.use "MongoidExt::FileServer"
8
+
@@ -0,0 +1,55 @@
1
+ base: &common
2
+ Google:
3
+ openid: https://www.google.com/accounts/o8/id
4
+ Yahoo:
5
+ openid: http://yahoo.com
6
+ AOL:
7
+ openid: 'http://openid.aol.com/{user_name}'
8
+ MySpace:
9
+ openid: 'http://www.myspace.com/{user_name}'
10
+ MyOpenID:
11
+ openid: 'http://{user_name}.myopenid.com/'
12
+ Wordpress:
13
+ openid: 'http://{user_name}.wordpress.com/'
14
+ Blogger:
15
+ openid: 'http://{user_name}.blogspot.com/'
16
+ Flickr:
17
+ openid: 'http://flickr.com/photos/{user_name}/'
18
+ Launchpad:
19
+ openid: 'https://launchpad.net/~{user_name}'
20
+ Vidoop:
21
+ openid: 'http://{user_name}.myvidoop.com/'
22
+ ClaimID:
23
+ openid: 'http://claimid.com/{user_name}'
24
+ Technorati:
25
+ openid: 'http://technorati.com/people/technorati/{user_name}/'
26
+ Verisign:
27
+ openid: 'http://{user_name}.pip.verisignlabs.com/'
28
+ LiveJournal:
29
+ openid: 'http://{user_name}.livejournal.com'
30
+ OpenId:
31
+ openid: '{user_name}'
32
+ Twitter:
33
+ id: 'ID'
34
+ token: 'TOKEN'
35
+ Identica:
36
+ id: 'ID'
37
+ token: 'TOKEN'
38
+ Facebook:
39
+ id: 'ID'
40
+ token: 'TOKEN'
41
+ Github:
42
+ id: 'ID'
43
+ token: 'TOKEN'
44
+ LinkedIn:
45
+ id: "ID"
46
+ token: "TOKEN"
47
+
48
+ development:
49
+ <<: *common
50
+
51
+ production:
52
+ <<: *common
53
+
54
+ test:
55
+ <<: *common
@@ -0,0 +1,15 @@
1
+ # Require any additional compass plugins here.
2
+
3
+ project_type = :rails
4
+ project_path = RAILS_ROOT if defined?(RAILS_ROOT)
5
+ # Set this to the root of your project when deployed:
6
+ http_path = "/"
7
+ css_dir = "public/stylesheets/compiled"
8
+ sass_dir = "app/stylesheets"
9
+ images_dir = "public/images"
10
+ javascripts_dir = "public/javascripts"
11
+ # To enable relative paths to assets via compass helper functions. Uncomment:
12
+ # relative_assets = true
13
+ http_images_path = "/images"
14
+ http_stylesheets_path = "/stylesheets"
15
+ http_javascripts_path = "/javascripts"
@@ -0,0 +1,5 @@
1
+ require 'compass'
2
+ # If you have any compass plugins, require them here.
3
+ Compass.add_project_configuration(File.join(RAILS_ROOT, "config", "compass.config"))
4
+ Compass.configuration.environment = RAILS_ENV.to_sym
5
+ Compass.configure_sass_plugin!
@@ -0,0 +1,13 @@
1
+ # put rails errors inline on the tags themselves
2
+ ActionView::Base.field_error_proc = (
3
+ Proc.new do |html_tag, instance|
4
+ class_name = "error"
5
+ d = HTML::Document.new(html_tag)
6
+ tag = d.root.children.first
7
+ if tag.attributes.has_key?('class')
8
+ tag.attributes["class"] += " #{class_name}"
9
+ else
10
+ tag.attributes["class"] = class_name
11
+ end
12
+ tag.to_s.html_safe
13
+ end)
@@ -0,0 +1,6 @@
1
+ .DS_Store
2
+ .bundle
3
+ log/*.log
4
+ tmp/**/*
5
+ db/*.sqlite3
6
+ Gemfile.lock
@@ -0,0 +1,7 @@
1
+ // jQuery Browser Plugin | Version 2.3 | http://jquery.thewikies.com/browser
2
+ (function($){$.browserTest=function(a,z){var u='unknown',x='X',m=function(r,h){for(var i=0;i<h.length;i=i+1){r=r.replace(h[i][0],h[i][1]);}return r;},c=function(i,a,b,c){var r={name:m((a.exec(i)||[u,u])[1],b)};r[r.name]=true;r.version=(c.exec(i)||[x,x,x,x])[3];if(r.name.match(/safari/)&&r.version>400){r.version='2.0';}if(r.name==='presto'){r.version=($.browser.version>9.27)?'futhark':'linear_b';}r.versionNumber=parseFloat(r.version,10)||0;r.versionX=(r.version!==x)?(r.version+'').substr(0,1):x;r.className=r.name+r.versionX;return r;};a=(a.match(/Opera|Navigator|Minefield|KHTML|Chrome/)?m(a,[[/(Firefox|MSIE|KHTML,\slike\sGecko|Konqueror)/,''],['Chrome Safari','Chrome'],['KHTML','Konqueror'],['Minefield','Firefox'],['Navigator','Netscape']]):a).toLowerCase();$.browser=$.extend((!z)?$.browser:{},c(a,/(camino|chrome|firefox|netscape|konqueror|lynx|msie|opera|safari)/,[],/(camino|chrome|firefox|netscape|netscape6|opera|version|konqueror|lynx|msie|safari)(\/|\s)([a-z0-9\.\+]*?)(\;|dev|rel|\s|$)/));$.layout=c(a,/(gecko|konqueror|msie|opera|webkit)/,[['konqueror','khtml'],['msie','trident'],['opera','presto']],/(applewebkit|rv|konqueror|msie)(\:|\/|\s)([a-z0-9\.]*?)(\;|\)|\s)/);$.os={name:(/(win|mac|linux|sunos|solaris|iphone)/.exec(navigator.platform.toLowerCase())||[u])[0].replace('sunos','solaris')};if(!z){$('html').addClass([$.os.name,$.browser.name,$.browser.className,$.layout.name,$.layout.className].join(' '));}};$.browserTest(navigator.userAgent);})(jQuery);
3
+
4
+ $(document).ready(function(){
5
+
6
+
7
+ });
@@ -0,0 +1 @@
1
+ jQuery(function($){var csrf_token=$('meta[name=csrf-token]').attr('content'),csrf_param=$('meta[name=csrf-param]').attr('content');$.fn.extend({triggerAndReturn:function(name,data){var event=new $.Event(name);this.trigger(event,data);return event.result!==false},callRemote:function(){var el=this,data=el.is('form')?el.serializeArray():[],method=el.attr('method')||el.attr('data-method')||'GET',url=el.attr('action')||el.attr('href');if(url===undefined){throw"No URL specified for remote call (action or href must be present).";}else{if(el.triggerAndReturn('ajax:before')){$.ajax({url:url,data:data,dataType:'script',type:method.toUpperCase(),beforeSend:function(xhr){el.trigger('ajax:loading',xhr)},success:function(data,status,xhr){el.trigger('ajax:success',[data,status,xhr])},complete:function(xhr){el.trigger('ajax:complete',xhr)},error:function(xhr,status,error){el.trigger('ajax:failure',[xhr,status,error])}})}el.trigger('ajax:after')}}});$('a[data-confirm],input[data-confirm]').live('click',function(){var el=$(this);if(el.triggerAndReturn('confirm')){if(!confirm(el.attr('data-confirm'))){return false}}});$('form[data-remote]').live('submit',function(e){$(this).callRemote();e.preventDefault()});$('a[data-remote],input[data-remote]').live('click',function(e){$(this).callRemote();e.preventDefault()});$('a[data-method]:not([data-remote])').live('click',function(e){var link=$(this),href=link.attr('href'),method=link.attr('data-method'),form=$('<form method="post" action="'+href+'">'),metadata_input='<input name="_method" value="'+method+'" type="hidden" />';if(csrf_param!=null&&csrf_token!=null){metadata_input+='<input name="'+csrf_param+'" value="'+csrf_token+'" type="hidden" />'}form.hide().append(metadata_input).appendTo('body');e.preventDefault();form.submit()});var disable_with_input_selector='input[data-disable-with]';var disable_with_form_selector='form[data-remote]:has('+disable_with_input_selector+')';$(disable_with_form_selector).live('ajax:before',function(){$(this).find(disable_with_input_selector).each(function(){var input=$(this);input.data('enable-with',input.val()).attr('value',input.attr('data-disable-with')).attr('disabled','disabled')})});$(disable_with_form_selector).live('ajax:after',function(){$(this).find(disable_with_input_selector).each(function(){var input=$(this);input.removeAttr('disabled').val(input.data('enable-with'))})})});
@@ -0,0 +1,13 @@
1
+ development:
2
+ database: magent-development
3
+ host: localhost
4
+ port: 27017
5
+ websocket_channel: magent.websocket
6
+
7
+ test:
8
+ database: magent-test
9
+
10
+ production:
11
+ database: magent-production
12
+ websocket_channel: magent.websocket
13
+
@@ -0,0 +1,10 @@
1
+ Magent.setup(YAML.load_file(Rails.root.join('config', 'magent.yml')),
2
+ Rails.env, {})
3
+
4
+
5
+ MongoidExt.init
6
+
7
+ Dir.glob("#{RAILS_ROOT}/app/models/**/*.rb") do |model_path|
8
+ File.basename(model_path, ".rb").classify.constantize
9
+ end
10
+
@@ -0,0 +1,23 @@
1
+ defaults: &defaults
2
+ host: localhost
3
+ autocreate_indexes: false
4
+ allow_dynamic_fields: true
5
+ include_root_in_json: false
6
+ parameterize_keys: true
7
+ persist_in_safe_mode: false
8
+ raise_not_found_error: true
9
+ reconnect_time: 3
10
+
11
+ development:
12
+ <<: *defaults
13
+ database: app-development
14
+ persist_in_safe_mode: true
15
+
16
+ test:
17
+ <<: *defaults
18
+ database: app-test
19
+
20
+ production:
21
+ <<: *defaults
22
+ database: app-production
23
+
@@ -0,0 +1,12 @@
1
+ // setup.sass | BOOTSTRAP YOUR PROJECT
2
+
3
+ // Default Body Styles
4
+ $background: white
5
+ $font-family: $helvetica
6
+ $font-size: $medium
7
+ $colour: darken(white, 93%)
8
+
9
+ // Default link colours/styles
10
+ $link_colour: blue
11
+ $hover_colour: purple
12
+ $active_colour: red
@@ -0,0 +1,15 @@
1
+ // DEFAULT LIBRARIES
2
+ @import lib/mixins
3
+ @import lib/variables
4
+ @import styles/variables
5
+ @import setup
6
+ @import lib/reset
7
+ @import lib/extend
8
+
9
+ // DEFAULT BASE STYLES
10
+ @import styles/extend
11
+ @import styles/mixins
12
+ @import styles/common
13
+ @import styles/template
14
+
15
+
@@ -0,0 +1,87 @@
1
+ // extend.sass | LIBRARY @EXTEND CLASSES
2
+
3
+ // Clearing Floats
4
+ ----------------------------------------------
5
+ .clear => For non-floating element immediately below a floating element.
6
+
7
+ .clearfix => For floating children inside a parent.
8
+ Class goes on parent holding floating children.
9
+
10
+ // Use all of these classes with the @extend option
11
+ .zoom
12
+ :zoom 1
13
+
14
+ .left
15
+ :float left
16
+
17
+ .right
18
+ :float right
19
+
20
+ .block
21
+ :display block
22
+
23
+ .absolute
24
+ :position absolute
25
+
26
+ .relative
27
+ :position relative
28
+
29
+ .center
30
+ :text-align center
31
+
32
+ .hidden
33
+ :overflow hidden
34
+
35
+ .bold
36
+ :font-weight bold
37
+
38
+ .clear
39
+ :clear both
40
+
41
+ .clearfix:after
42
+ @extend .clear
43
+ @extend .block
44
+ :content ""
45
+
46
+ // Replacing text with a background image
47
+ .hide-text, .h
48
+ @extend .block
49
+ @extend .hidden
50
+ :font-size 0
51
+ :text-indent -9999em
52
+ :white-space nowrap
53
+ :.text-transform capitalize
54
+
55
+ // Reset some basic styling
56
+ .reset, .r
57
+ :border 0
58
+ :margin 0
59
+ :padding 0
60
+
61
+ // Consolidate fonts. Works with font $variables in lib/variables.
62
+ .font_x-small
63
+ :font-size $x-small
64
+
65
+ .font_small
66
+ :font-size $small
67
+
68
+ .font_medium
69
+ :font-size $medium
70
+
71
+ .font_x-medium
72
+ :font-size $x-medium
73
+
74
+ .font_large
75
+ :font-size $large
76
+
77
+ .font_x-large
78
+ :font-size $x-large
79
+
80
+ .font_xx-large
81
+ :font-size $xx-large
82
+
83
+ .font_huge
84
+ :font-size $huge
85
+
86
+ .font_x-huge
87
+ :font-size $x-huge