pixelearth 3.2.2 → 3.2.4

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.
Files changed (62) hide show
  1. data/app/assets/images/bgs/tan_textured.png +0 -0
  2. data/app/assets/images/icons/aa.gif +0 -0
  3. data/app/assets/images/icons/accept.png +0 -0
  4. data/app/assets/images/icons/arrow.png +0 -0
  5. data/app/assets/images/icons/back.png +0 -0
  6. data/app/assets/images/icons/block.png +0 -0
  7. data/app/assets/images/icons/coupon.png +0 -0
  8. data/app/assets/images/icons/destroy.png +0 -0
  9. data/app/assets/images/icons/dialog.png +0 -0
  10. data/app/assets/images/icons/download.png +0 -0
  11. data/app/assets/images/icons/edit.png +0 -0
  12. data/app/assets/images/icons/help.png +0 -0
  13. data/app/assets/images/icons/info.png +0 -0
  14. data/app/assets/images/icons/list_all.png +0 -0
  15. data/app/assets/images/icons/loading.gif +0 -0
  16. data/app/assets/images/icons/mail_send.png +0 -0
  17. data/app/assets/images/icons/new.png +0 -0
  18. data/app/assets/images/icons/next.png +0 -0
  19. data/app/assets/images/icons/no_avatar.jpg +0 -0
  20. data/app/assets/images/icons/process.png +0 -0
  21. data/app/assets/images/icons/show.png +0 -0
  22. data/app/assets/images/icons/spinning_wheel.gif +0 -0
  23. data/app/assets/images/icons/user.png +0 -0
  24. data/app/assets/images/icons/users.png +0 -0
  25. data/app/assets/images/icons/warning.png +0 -0
  26. data/app/assets/images/icons/wrench.png +0 -0
  27. data/app/assets/javascripts/application.js +9 -0
  28. data/app/assets/stylesheets/admin_layout.css.scss.erb +91 -0
  29. data/app/assets/stylesheets/defaults.css.scss.erb +26 -0
  30. data/app/assets/stylesheets/manifest_admin.css +11 -0
  31. data/app/assets/stylesheets/manifest_common.css +15 -0
  32. data/app/assets/stylesheets/pagination_will_paginate.scss.erb +68 -0
  33. data/app/assets/stylesheets/portable.css.scss.erb +151 -0
  34. data/app/assets/stylesheets/reset.css.scss.erb +50 -0
  35. data/app/assets/stylesheets/scaffolds.css.scss +58 -0
  36. data/app/assets/stylesheets/simple_form.scss +76 -0
  37. data/app/assets/stylesheets/validation_errors.scss +35 -0
  38. data/app/controllers/pixelearth_base/application_controller.rb +5 -0
  39. data/app/helpers/admin_panel_helpers.rb +13 -0
  40. data/app/helpers/application_controller_instance_methods_and_helpers.rb +8 -0
  41. data/app/helpers/controller_helpers.rb +128 -0
  42. data/app/helpers/layout_helpers.rb +5 -0
  43. data/app/helpers/pixelearth_base/application_helper.rb +6 -0
  44. data/app/helpers/view_helpers.rb +66 -0
  45. data/app/views/layouts/admin.html.haml +76 -0
  46. data/app/views/layouts/application.html.haml +61 -0
  47. data/app/views/pixelearth_base/_pagination.html.haml +8 -0
  48. data/app/views/pixelearth_base/admin/_admin_buttons.html.haml +20 -0
  49. data/app/views/pixelearth_base/admin/_form_errors.html.haml +8 -0
  50. data/app/views/pixelearth_base/admin/_show_edit_destroy.html.haml +6 -0
  51. data/config/initializers/active_record.rb +23 -0
  52. data/config/initializers/application_controller_additions.rb +31 -0
  53. data/config/initializers/date_formats.rb +5 -0
  54. data/config/initializers/rails_core_mods.rb +0 -0
  55. data/config/initializers/ruby_core_mods.rb +30 -0
  56. data/config/initializers/string.rb +22 -0
  57. data/config/routes.rb +0 -0
  58. data/lib/generators/project_files/templates/images/icons/aa.gif +0 -0
  59. data/lib/pixelearth.rb +4 -9
  60. data/lib/pixelearth/version.rb +1 -1
  61. data/lib/required/string.rb +3 -0
  62. metadata +61 -3
@@ -0,0 +1,61 @@
1
+ !!!
2
+ %html
3
+ %head
4
+ = stylesheet_link_tag "application"
5
+ = javascript_include_tag "application"
6
+ = csrf_meta_tags
7
+
8
+ = stylesheet_link_tag *@layout[:css]
9
+
10
+ /%link{ :rel => "shortcut icon", :href => "/favicon.ico", :type => "image/x-icon"}/
11
+ %title
12
+ = @layout[:title] || default_view_title
13
+
14
+ %meta{:name => 'keywords' , :content => @layout[:keywords]}
15
+ %meta{:name => 'description' , :content => @layout[:desc]}
16
+ %meta{:name => 'robots' , :content => @layout[:all]}
17
+ %meta{'http-equiv' => 'content-type' , :content => "text/html; charset=utf-8"}
18
+
19
+ -#= csrf_meta_tag
20
+ = stylesheet_link_tag @layout[:css].flatten.uniq
21
+ = javascript_include_tag @layout[:js].flatten.uniq
22
+
23
+
24
+ %style
25
+ = yield :styles
26
+
27
+
28
+ %body#body.admin_layout{:class=>"#{params[:controller]} #{params[:action]}"}
29
+
30
+ #container1
31
+ #container2
32
+ #container3
33
+ %nav
34
+ = link_to 'home', '/'
35
+
36
+ .content
37
+
38
+ - if @layout[:show_h1]
39
+ %h1
40
+ = raw @layout[:h1] || default_view_title
41
+
42
+ /Flash Message
43
+ = display_flash
44
+
45
+ /page content
46
+ = yield
47
+
48
+ =clear
49
+
50
+
51
+ /end .container_3
52
+ /end .container2
53
+ /end .container1
54
+
55
+
56
+
57
+ .dark.debug
58
+ =debug params
59
+ =debug session
60
+
61
+ =clear
@@ -0,0 +1,8 @@
1
+ .pagination_bar
2
+ = will_paginate collection
3
+ .info
4
+ = page_entries_info collection, :entry_name => ''
5
+
6
+ = clear
7
+
8
+
@@ -0,0 +1,20 @@
1
+ #admin_buttons
2
+
3
+ -case params[:action]
4
+ -when 'index'
5
+ //new
6
+ =link_to image_tag('icons/new.png', :alt=>'[new]'), send("new_#{params[:controller].singularize}_path"), :class => 'admin_new', :title => 'New'
7
+ -when 'new', 'create'
8
+ //index
9
+ =link_to image_tag('icons/list_all.png', :alt=>"[List All #{params[:controller].titleize}]"), send("#{params[:controller]}_path"), :class => 'admin_list', :title => "All #{params[:controller].titleize}"
10
+ -when 'show'
11
+ //edit, index
12
+ =link_to image_tag('icons/list_all.png', :alt=>"[List All #{params[:controller].titleize}]"), send("#{params[:controller]}_path"), :class => 'admin_list', :title => "List All #{params[:controller].titleize}"
13
+ =link_to image_tag('icons/edit.png', :alt=>"[Edit]"), send("edit_#{params[:controller].singularize}_path"), :class => 'admin_edit', :title => 'Edit'
14
+ -when 'edit', 'update'
15
+ /show, index
16
+ =link_to image_tag('icons/list_all.png', :alt=>"[List All #{params[:controller].titleize}]"), send("#{params[:controller]}_path"), :class => 'admin_list', :title => "List All #{params[:controller].titleize}"
17
+ =link_to image_tag('icons/show.png', :alt=>'[show]'), send("#{params[:controller].singularize}_path", @resource), :class => 'admin_show', :title => 'Show'
18
+
19
+
20
+
@@ -0,0 +1,8 @@
1
+ -if @resource.errors.any?
2
+ #error_explanation
3
+ %h2= "#{pluralize(@resource.errors.count, "error")} prohibited this #{@resource.class.to_s.titleize} from being saved:"
4
+ %ul
5
+ - @resource.errors.full_messages.each do |msg|
6
+ %li= msg
7
+
8
+
@@ -0,0 +1,6 @@
1
+ .show_edit_destroy_box
2
+ =link_to image_tag('icons/show.png', :alt=>'[show]'), resource, :class => 'admin_show', :title => 'Show'
3
+ =link_to image_tag('icons/edit.png', :alt=>'[edit]'), send("edit_#{resource.class.table_name.singularize}_path", resource), :class => 'admin_edit', :title => 'Edit'
4
+ =link_to image_tag('icons/destroy.png', :alt=>'[destroy]'), resource, :confirm => 'Are you sure?', :method => :delete, :class => 'admin_destroy', :title => 'Destroy'
5
+
6
+
@@ -0,0 +1,23 @@
1
+ class ActiveRecord::Base
2
+
3
+ include Rails.application.routes.url_helpers #makes routes available in models (I know I know)
4
+
5
+ def self.random
6
+ if (c = count) != 0
7
+ find(:first, :offset =>rand(c))
8
+ end
9
+ end
10
+ def titleize
11
+ name.titleize
12
+ end
13
+ def self.uses_slug(attrib = :name)
14
+ define_method(:to_param) do
15
+ "#{self.id}-#{self.send(attrib).parameterize}"
16
+ end
17
+ end
18
+
19
+ end
20
+
21
+
22
+
23
+
@@ -0,0 +1,31 @@
1
+ module ActionController
2
+ class Base
3
+
4
+ include ApplicationControllerInstanceMethodsAndHelpers
5
+ helper_method ApplicationControllerInstanceMethodsAndHelpers.instance_methods
6
+
7
+ before_filter :setup
8
+
9
+ def setup
10
+ #base config for layout, actions can add to this
11
+ @layout = {
12
+ :show_h1 => true, #set to false when don't want to show default h1
13
+ :css => [
14
+ 'manifest_common'
15
+ ],
16
+ :js => [
17
+ ],
18
+ :admin => {
19
+ :title => 'My Default Admin Title',
20
+ :css => [
21
+ 'manifest_admin'
22
+ ],
23
+ :js => [
24
+ ]
25
+ }
26
+
27
+ }
28
+ end
29
+
30
+ end
31
+ end
@@ -0,0 +1,5 @@
1
+ Time::DATE_FORMATS[:no_time] = "%B %d, %Y"
2
+ Time::DATE_FORMATS[:time] = "%l:%M %p"
3
+
4
+
5
+
File without changes
@@ -0,0 +1,30 @@
1
+ class String
2
+ def first_caps
3
+ self.split(/ /).map{|x| x.capitalize}.join(' ')
4
+ end
5
+ def sp_to_underscore #fills in the gap in rails inflectors, since their #underscore method only works for CamelCase
6
+ self.downcase.gsub(/\s+/,"_")
7
+ end
8
+ end
9
+ class Hash
10
+ def to_s_pretty
11
+ self.collect {|k,v| "#{k}: #{v}"}.join(', ')
12
+ end
13
+ end
14
+ class Dir
15
+ def filter(regex)
16
+ self.select do |x|
17
+ x =~ regex
18
+ end
19
+ end
20
+ end
21
+
22
+ class Object
23
+ end
24
+
25
+ class Numeric
26
+ def secs_to_days
27
+ self / (60.0 * 60 * 24)
28
+ end
29
+ end
30
+
@@ -0,0 +1,22 @@
1
+ class String
2
+ def first_caps
3
+ self.split(/ /).map{|x| x.capitalize}.join(' ')
4
+ end
5
+ def my_underscore #fills in the gap in rails inflectors, since their #underscore method only works for CamelCase
6
+ self.downcase.gsub(/\s+/,"_")
7
+ end
8
+ def titleize #overloads
9
+ titleized_words = self.split.collect do |word|
10
+ unless word.match(/[A-Z]{2}/)
11
+ word.underscore.humanize.gsub(/\b('?[a-z])/) { $1.capitalize }
12
+ #humanize(underscore(word)).gsub(/\b('?[a-z])/) { $1.capitalize } #this is from rails source and didn't work
13
+ else
14
+ word
15
+ end
16
+ end
17
+
18
+ titleized_words.join(' ')
19
+ end
20
+ end
21
+
22
+
data/config/routes.rb ADDED
File without changes
data/lib/pixelearth.rb CHANGED
@@ -1,13 +1,8 @@
1
- this_dir = File.expand_path('../', __FILE__)
2
-
3
- require 'rails'
4
- require 'haml-rails'
5
- require 'redcloth'
6
- require 'simple_form'
7
- require 'colored'
8
- require 'ap'
9
-
1
+ puts '------------------------'
2
+ puts '------------------------'
3
+ puts '------------------------'
10
4
 
5
+ this_dir = File.expand_path('../', __FILE__)
11
6
 
12
7
  Dir.glob("#{this_dir}/required/*.rb").each do |x|
13
8
  require x;
@@ -1,3 +1,3 @@
1
1
  module Pixelearth
2
- VERSION = "3.2.2"
2
+ VERSION = "3.2.4"
3
3
  end
@@ -5,4 +5,7 @@ class String
5
5
  def my_underscore #fills in the gap in rails inflectors, since their #underscore method only works for CamelCase
6
6
  self.downcase.gsub(/\s+/,"_")
7
7
  end
8
+ def from_pe
9
+ "hi, I'm from the pixelearth gem"
10
+ end
8
11
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pixelearth
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 7
5
5
  prerelease:
6
6
  segments:
7
7
  - 3
8
8
  - 2
9
- - 2
10
- version: 3.2.2
9
+ - 4
10
+ version: 3.2.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Benjamin Lieb
@@ -44,8 +44,66 @@ files:
44
44
  - .gitignore
45
45
  - Gemfile
46
46
  - Rakefile
47
+ - app/assets/images/bgs/tan_textured.png
48
+ - app/assets/images/icons/aa.gif
49
+ - app/assets/images/icons/accept.png
50
+ - app/assets/images/icons/arrow.png
51
+ - app/assets/images/icons/back.png
52
+ - app/assets/images/icons/block.png
53
+ - app/assets/images/icons/coupon.png
54
+ - app/assets/images/icons/destroy.png
55
+ - app/assets/images/icons/dialog.png
56
+ - app/assets/images/icons/download.png
57
+ - app/assets/images/icons/edit.png
58
+ - app/assets/images/icons/help.png
59
+ - app/assets/images/icons/info.png
60
+ - app/assets/images/icons/list_all.png
61
+ - app/assets/images/icons/loading.gif
62
+ - app/assets/images/icons/mail_send.png
63
+ - app/assets/images/icons/new.png
64
+ - app/assets/images/icons/next.png
65
+ - app/assets/images/icons/no_avatar.jpg
66
+ - app/assets/images/icons/process.png
67
+ - app/assets/images/icons/show.png
68
+ - app/assets/images/icons/spinning_wheel.gif
69
+ - app/assets/images/icons/user.png
70
+ - app/assets/images/icons/users.png
71
+ - app/assets/images/icons/warning.png
72
+ - app/assets/images/icons/wrench.png
73
+ - app/assets/javascripts/application.js
74
+ - app/assets/stylesheets/admin_layout.css.scss.erb
75
+ - app/assets/stylesheets/defaults.css.scss.erb
76
+ - app/assets/stylesheets/manifest_admin.css
77
+ - app/assets/stylesheets/manifest_common.css
78
+ - app/assets/stylesheets/pagination_will_paginate.scss.erb
79
+ - app/assets/stylesheets/portable.css.scss.erb
80
+ - app/assets/stylesheets/reset.css.scss.erb
81
+ - app/assets/stylesheets/scaffolds.css.scss
82
+ - app/assets/stylesheets/simple_form.scss
83
+ - app/assets/stylesheets/validation_errors.scss
84
+ - app/controllers/pixelearth_base/application_controller.rb
85
+ - app/helpers/admin_panel_helpers.rb
86
+ - app/helpers/application_controller_instance_methods_and_helpers.rb
87
+ - app/helpers/controller_helpers.rb
88
+ - app/helpers/layout_helpers.rb
89
+ - app/helpers/pixelearth_base/application_helper.rb
90
+ - app/helpers/view_helpers.rb
91
+ - app/views/layouts/admin.html.haml
92
+ - app/views/layouts/application.html.haml
93
+ - app/views/pixelearth_base/_pagination.html.haml
94
+ - app/views/pixelearth_base/admin/_admin_buttons.html.haml
95
+ - app/views/pixelearth_base/admin/_form_errors.html.haml
96
+ - app/views/pixelearth_base/admin/_show_edit_destroy.html.haml
97
+ - config/initializers/active_record.rb
98
+ - config/initializers/application_controller_additions.rb
99
+ - config/initializers/date_formats.rb
100
+ - config/initializers/rails_core_mods.rb
101
+ - config/initializers/ruby_core_mods.rb
102
+ - config/initializers/string.rb
103
+ - config/routes.rb
47
104
  - lib/generators/project_files/USAGE
48
105
  - lib/generators/project_files/project_files_generator.rb
106
+ - lib/generators/project_files/templates/images/icons/aa.gif
49
107
  - lib/generators/project_files/templates/images/icons/accept.png
50
108
  - lib/generators/project_files/templates/images/icons/back.png
51
109
  - lib/generators/project_files/templates/images/icons/block.png