lalala 4.0.0.dev.416 → 4.1.0.dev.299

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -1
  3. data/Gemfile +1 -3
  4. data/Haraway.md +14 -0
  5. data/app/assets/javascripts/lalala/base.js +8 -0
  6. data/app/assets/javascripts/lalala/initializers/chosen.module.js +3 -0
  7. data/app/assets/javascripts/lalala/initializers/haraway.module.js +8 -0
  8. data/app/assets/javascripts/lalala/lib/overlay.js +335 -0
  9. data/app/assets/javascripts/lalala/modules/collapsible_pages_tree.module.js +26 -33
  10. data/app/assets/javascripts/lalala/modules/editor.module.js +37 -23
  11. data/app/assets/javascripts/lalala/modules/file-uploader-metadata.module.js +248 -0
  12. data/app/assets/javascripts/lalala/modules/file-uploader.module.js +376 -0
  13. data/app/assets/javascripts/lalala/modules/init.module.js +1 -5
  14. data/app/assets/javascripts/lalala/modules/media_selector.module.js +250 -0
  15. data/app/assets/javascripts/lalala/modules/overlay.module.js +33 -0
  16. data/app/assets/stylesheets/lalala/_base.css.scss +5 -2
  17. data/app/assets/stylesheets/lalala/components/_buttons.css.scss +11 -3
  18. data/app/assets/stylesheets/lalala/components/_forms.css.scss +14 -64
  19. data/app/assets/stylesheets/lalala/lib/_overlay.css.scss +66 -0
  20. data/app/assets/stylesheets/lalala/modules/_dashboard.css.scss +10 -51
  21. data/app/assets/stylesheets/lalala/modules/_editor-cheatsheet.css.scss +1 -17
  22. data/app/assets/stylesheets/lalala/modules/_file-uploader-metadata.css.scss +118 -0
  23. data/app/assets/stylesheets/lalala/modules/_file-uploader.css.scss +289 -0
  24. data/app/assets/stylesheets/lalala/modules/_media-selector.css.scss +113 -0
  25. data/app/assets/stylesheets/lalala/modules/_title-bar.css.scss +0 -17
  26. data/app/controllers/lalala/public/errors_controller.rb +7 -0
  27. data/app/models/lalala/page.rb +0 -1
  28. data/app/views/lalala/markdown/cheatsheet.html.erb +0 -2
  29. data/config/routes.rb +12 -1
  30. data/lalala-assets.gemspec +3 -3
  31. data/lalala-development.gemspec +1 -1
  32. data/lalala-test.gemspec +1 -1
  33. data/lalala.gemspec +4 -5
  34. data/lib/formtastic/form_builder_ext.rb +10 -0
  35. data/lib/formtastic/inputs/haraway_input.rb +151 -0
  36. data/lib/generators/lalala/assets/templates/bower.json.erb +1 -1
  37. data/lib/generators/lalala/install/install_generator.rb +0 -23
  38. data/lib/lalala/admin/pages.rb +1 -26
  39. data/lib/lalala/engine.rb +0 -7
  40. data/lib/lalala/ext_action_dispatch.rb +0 -1
  41. data/lib/lalala/ext_active_record/i18n_translations_writer.rb +0 -1
  42. data/lib/lalala/ext_active_record.rb +0 -1
  43. data/lib/lalala/ext_i18n/input_helper.rb +0 -1
  44. data/lib/lalala/ext_i18n/negotiation_adapter.rb +0 -4
  45. data/lib/lalala/ext_i18n/test_negotiation_adapter.rb +0 -4
  46. data/lib/lalala/ext_rack/i18n_negotiator.rb +7 -9
  47. data/lib/lalala/markdown/handlers/asset.rb +24 -0
  48. data/lib/lalala/markdown/handlers/youtube.rb +9 -13
  49. data/lib/lalala/markdown/html_renderer.rb +2 -2
  50. data/lib/lalala/markdown.rb +2 -3
  51. data/lib/lalala/utils/install_template.rb +3 -9
  52. data/lib/lalala/version.rb +2 -2
  53. data/lib/lalala.rb +6 -7
  54. data/script/ci +33 -30
  55. data/test/dummy/app/admin/articles.rb +26 -12
  56. data/test/dummy/app/admin/dashboard.rb +5 -8
  57. data/test/dummy/app/admin/tags.rb +1 -3
  58. data/test/dummy/app/assets/stylesheets/_normalize.css +423 -0
  59. data/test/dummy/app/assets/stylesheets/application.css.scss +2 -0
  60. data/test/dummy/app/assets/stylesheets/base/_base.css.scss +4 -0
  61. data/test/dummy/app/controllers/pages_controller.rb +4 -0
  62. data/test/dummy/app/models/article.rb +10 -4
  63. data/test/dummy/app/pages/application_page.rb +7 -2
  64. data/test/dummy/app/pages/basic_page.rb +5 -6
  65. data/test/dummy/app/pages/home_page.rb +10 -10
  66. data/test/dummy/app/pages/media_page.rb +23 -0
  67. data/test/dummy/app/views/admin/_stats.html.erb +7 -14
  68. data/test/dummy/app/views/layouts/application.html.erb +6 -2
  69. data/test/dummy/app/views/pages/media.html.erb +3 -0
  70. data/test/dummy/config/initializers/haraway.rb +29 -0
  71. data/test/dummy/config/routes.rb +1 -0
  72. data/test/dummy/db/migrate/20130528092721_create_articles.rb +1 -0
  73. data/test/dummy/db/migrate/20130729125648_create_home_page.rb +4 -0
  74. data/test/dummy/db/migrate/20131122144302_enable_haraway.rb +16 -0
  75. data/test/dummy/db/migrate/20140228141749_create_media_page.rb +8 -0
  76. data/test/dummy/db/schema.rb +2 -4
  77. data/test/integration/aricles_test.rb +0 -1
  78. metadata +59 -81
  79. data/app/assets/javascripts/jquery-ui/sortable.js +0 -0
  80. data/app/assets/javascripts/lalala/lib/jquery-ui.js +0 -16617
  81. data/app/assets/javascripts/lalala/modules/grid.module.js +0 -284
  82. data/app/assets/javascripts/lalala/modules/input_group.module.js +0 -36
  83. data/app/assets/stylesheets/lalala/modules/_grid.css.scss +0 -197
  84. data/app/assets/stylesheets/lalala/modules/_index-as-sortable.css.scss +0 -89
  85. data/app/models/lalala/abstract_asset.rb +0 -24
  86. data/app/models/lalala/file_asset.rb +0 -3
  87. data/app/models/lalala/image_asset.rb +0 -3
  88. data/config/initializers/carrierwave.rb +0 -34
  89. data/lib/formtastic/inputs/grid_input.rb +0 -159
  90. data/lib/formtastic/inputs/single_file_input.rb +0 -44
  91. data/lib/generators/lalala/install/templates/application.html.erb +0 -64
  92. data/lib/generators/lalala/install/templates/helpers/application_helper.rb +0 -16
  93. data/lib/generators/lalala/install/templates/helpers/html_helper.rb +0 -60
  94. data/lib/generators/lalala/install/templates/helpers/open_graph_helper.rb.erb +0 -92
  95. data/lib/generators/lalala/install/templates/helpers/pages_helper.rb +0 -15
  96. data/lib/generators/lalala/install/templates/locales/en.yml +0 -6
  97. data/lib/generators/lalala/install/templates/uploaders/file_uploader.rb +0 -2
  98. data/lib/generators/lalala/install/templates/uploaders/image_uploader.rb +0 -11
  99. data/lib/lalala/ext_action_dispatch/multi_file_upload.rb +0 -55
  100. data/lib/lalala/ext_active_record/assets.rb +0 -25
  101. data/lib/lalala/markdown/handlers/soundcloud.rb +0 -36
  102. data/lib/lalala/markdown/handlers/vimeo.rb +0 -40
  103. data/lib/lalala/uploaders/file.rb +0 -50
  104. data/lib/lalala/uploaders/image.rb +0 -13
  105. data/lib/lalala/uploaders.rb +0 -6
  106. data/test/dummy/app/assets/stylesheets/application.css +0 -13
  107. data/test/dummy/app/models/file_asset.rb +0 -2
  108. data/test/dummy/app/models/image_asset.rb +0 -2
  109. data/test/dummy/app/uploaders/file_uploader.rb +0 -2
  110. data/test/dummy/app/uploaders/image_uploader.rb +0 -11
  111. data/test/dummy/db/migrate/20140926152646_add_pre_and_postpend_test_columns_to_articles.rb +0 -6
@@ -0,0 +1,151 @@
1
+ class Formtastic::Inputs::HarawayInput
2
+ include Formtastic::Inputs::Base
3
+
4
+ def to_html
5
+ object = builder.object
6
+ klass = Formtastic::Inputs::HarawayInput
7
+ param_key = "#{object.class.table_name.singularize}[#{method}]"
8
+ title = method.to_s.pluralize.titleize
9
+ assets = object.send(method)
10
+ accepts = Haraway.configuration.profiles[method.to_s].try(:accepted_file_types)
11
+ accepts = accepts.join(", ") if accepts
12
+
13
+ sorted_assets = klass.sorted_assets(assets.clone).map do |asset|
14
+ klass.xfile_html(self, template, param_key, asset)
15
+ end
16
+
17
+ <<-EOT
18
+
19
+ <x-files profile="#{method}" accept="#{accepts}" name="#{param_key}">
20
+ <header>
21
+ <div class="col-a">
22
+ <span class="name">#{title}</span>
23
+ <a class="choose">Browse files</a>
24
+ </div>
25
+ <div class="col-b">
26
+ <div class="info-button"></div>
27
+ <div class="data-inspection"></div>
28
+ </div>
29
+ </header>
30
+
31
+ <template class="x-file-template">
32
+ <div class="title"></div>
33
+ <div class="status-bar">
34
+ <div class="upload-bar"></div>
35
+ <div class="process-bar"></div>
36
+ </div>
37
+
38
+ #{ klass.menu_html }
39
+ </template>
40
+
41
+ <template class="form-template">
42
+ #{ asset_attributes_form(template, param_key) }
43
+ </template>
44
+
45
+ <div class="file-container">
46
+ <div class="inner-wrapper">
47
+ #{ sorted_assets.join("") }
48
+ </div>
49
+ </div>
50
+
51
+ <div class="meta-versions">
52
+ #{ versions(method) }
53
+ </div>
54
+ </x-files>
55
+
56
+ EOT
57
+ end
58
+
59
+
60
+ def asset_attributes_form(template, param_key, asset=nil)
61
+ if block = @options[:block]
62
+ h = @builder.semantic_fields_for(@method, asset, index: "", &block)
63
+ else
64
+ h = ""
65
+ end
66
+
67
+ # select
68
+ h.gsub!("<select ", "<select class=\"bypass-chosen\" ")
69
+
70
+ # return
71
+ h
72
+ end
73
+
74
+
75
+ def versions(profile)
76
+ profile = Haraway.configuration.profiles[profile.to_s]
77
+
78
+ # collect data
79
+ if profile
80
+ versions = profile.versions.keys.map do |key|
81
+ version = profile.versions[key.to_s]
82
+
83
+ OpenStruct.new(
84
+ name: version.name,
85
+ params: version.steps.first.try(:[], "params")
86
+ )
87
+ end.compact
88
+
89
+ else
90
+ versions = []
91
+
92
+ end
93
+
94
+ # make html
95
+ versions.map do |version|
96
+ <<-EOS
97
+ <script class="version" data-name="#{version.name}" type="application/json">
98
+ #{version.params.to_json}
99
+ </script>
100
+ EOS
101
+ end.join("")
102
+ end
103
+
104
+
105
+ #
106
+ # Utilities
107
+ #
108
+ def self.sorted_assets(array)
109
+ array
110
+ end
111
+
112
+
113
+ def self.xfile_html(input, template, param_key, asset)
114
+ asset_url_original = (asset.url(:original) rescue "")
115
+ asset_url_thumb = (asset.url(:thumb) rescue "")
116
+
117
+ <<-EOT
118
+
119
+ <x-file class="uploaded saved-to-db" data-src-original="#{ asset_url_original }">
120
+ <div class="thumb" style="background-image: url(#{ asset_url_thumb });"></div>
121
+
122
+ #{ Formtastic::Inputs::HarawayInput.menu_html }
123
+ #{ template.hidden_field_tag(param_key + "[][id]", asset.id) }
124
+ #{ template.hidden_field_tag(param_key + "[][_destroy]", "") }
125
+
126
+ <div class="attributes">
127
+ #{ input.asset_attributes_form(template, param_key, asset) }
128
+ </div>
129
+
130
+ <div class="meta">
131
+ <div class="row"></div>
132
+ </div>
133
+ </x-file>
134
+
135
+ EOT
136
+ end
137
+
138
+
139
+ def self.menu_html
140
+ <<-EOT
141
+
142
+ <div class="menu">
143
+ <a data-action="delete"></a>
144
+ <a data-action="meta"></a>
145
+ <a data-action="move"></a>
146
+ </div>
147
+
148
+ EOT
149
+ end
150
+
151
+ end
@@ -4,7 +4,7 @@
4
4
  "version": "0.0.1",
5
5
  "main": "javascripts/application.js",
6
6
  "dependencies": {
7
- "jquery": "~1",
7
+ "jquery": "~1.10.2",
8
8
  "modernizr": "~2.7.1",
9
9
  "respond": "~1.4.2",
10
10
  "normalize-scss": "~2.1.3"
@@ -60,30 +60,11 @@ module Lalala
60
60
  template 'dashboard.rb', 'app/admin/dashboard.rb'
61
61
  end
62
62
 
63
- def setup_uploaders
64
- empty_directory "app/uploaders"
65
- copy_file "uploaders/file_uploader.rb", "app/uploaders/file_uploader.rb"
66
- copy_file "uploaders/image_uploader.rb", "app/uploaders/image_uploader.rb"
67
- end
68
-
69
63
  def setup_environment_configs
70
64
  template "staging.rb.erb", "config/environments/staging.rb"
71
65
  gsub_file "config/environments/production.rb", " # config.assets.precompile += %w( search.js )", " config.assets.precompile += %w( modernizr.js )"
72
66
  end
73
67
 
74
- def setup_helpers
75
- empty_directory "app/helpers"
76
- copy_file "helpers/application_helper.rb", "app/helpers/application_helper.rb"
77
- template "helpers/open_graph_helper.rb.erb", "app/helpers/open_graph_helper.rb"
78
- copy_file "helpers/html_helper.rb", "app/helpers/html_helper.rb"
79
- copy_file "helpers/pages_helper.rb", "app/helpers/pages_helper.rb"
80
- end
81
-
82
- def setup_locales
83
- empty_directory 'config/locales'
84
- copy_file 'locales/en.yml', 'config/locales/en.yml'
85
- end
86
-
87
68
  def setup_forklift
88
69
  empty_directory ".forklift"
89
70
  end
@@ -92,10 +73,6 @@ module Lalala
92
73
  copy_file 'application_mailer.html.erb', 'app/views/layouts/application_mailer.html.erb'
93
74
  end
94
75
 
95
- def copy_default_layout
96
- copy_file 'application.html.erb', 'app/views/layouts/application.html.erb'
97
- end
98
-
99
76
  def create_assets
100
77
  generate "lalala:assets"
101
78
  end
@@ -1,24 +1,11 @@
1
1
  if defined?(ActiveAdmin) and defined?(ApplicationPage)
2
2
  ActiveAdmin.register ApplicationPage, :as => 'Page' do
3
+
3
4
  menu priority: 20, html_options: { class: 'icon-page' }
4
5
 
5
6
  config.filters = false
6
7
  config.paginate = false
7
8
 
8
- # Remove action buttons in topbar
9
- config.clear_action_items!
10
-
11
- # Edit button in topbar only on show
12
- action_item :only => [:show] do
13
- if controller.action_methods.include?('edit')
14
- link_to(I18n.t('active_admin.edit_model', :model => active_admin_config.resource_name), edit_resource_path)
15
- end
16
- end
17
-
18
-
19
- #
20
- # Index
21
- #
22
9
  index as: :tree_table, paginator: false, download_links: false do
23
10
  selectable_column
24
11
 
@@ -57,10 +44,6 @@ if defined?(ActiveAdmin) and defined?(ApplicationPage)
57
44
 
58
45
  end
59
46
 
60
-
61
- #
62
- # Form
63
- #
64
47
  form do |f|
65
48
  h = "".html_safe
66
49
  if f.object.new_record?
@@ -71,10 +54,6 @@ if defined?(ActiveAdmin) and defined?(ApplicationPage)
71
54
  h
72
55
  end
73
56
 
74
-
75
- #
76
- # Order action
77
- #
78
57
  collection_action :order, :method => :put do
79
58
  unless Array === params[:ordered_ids]
80
59
  render status: 422
@@ -89,10 +68,6 @@ if defined?(ActiveAdmin) and defined?(ApplicationPage)
89
68
  render json: { status: "OK" }, status: 200
90
69
  end
91
70
 
92
-
93
- #
94
- # Controller
95
- #
96
71
  controller do
97
72
 
98
73
  def new
data/lib/lalala/engine.rb CHANGED
@@ -12,7 +12,6 @@ module Lalala
12
12
  config.lalala = ActiveSupport::OrderedOptions.new
13
13
  config.lalala.i18n = ActiveSupport::OrderedOptions.new
14
14
  config.lalala.i18n.adapter = nil
15
- config.lalala.i18n.allow_accept_language = true
16
15
 
17
16
  initializer "lalala.migrations" do |app|
18
17
  app.class.configure do
@@ -115,9 +114,6 @@ module Lalala
115
114
  ActiveRecord::Base.send(
116
115
  :include, Lalala::ExtActiveRecord::I18nTranslationsWriter)
117
116
 
118
- ActiveRecord::Base.send(
119
- :include, Lalala::ExtActiveRecord::Assets)
120
-
121
117
  end
122
118
 
123
119
  ActiveSupport.on_load :action_controller do
@@ -125,9 +121,6 @@ module Lalala
125
121
  ActionDispatch::Routing::Mapper.send(
126
122
  :include, Lalala::Pages::RouteMapper)
127
123
 
128
- ActionDispatch::Request.send(
129
- :include, Lalala::ExtActionDispatch::MultiFileUpload)
130
-
131
124
  ActionDispatch::Request.send(
132
125
  :include, Lalala::ExtActionDispatch::PageName)
133
126
 
@@ -1,6 +1,5 @@
1
1
  module Lalala::ExtActionDispatch
2
2
  extend ActiveSupport::Autoload
3
3
 
4
- autoload :MultiFileUpload
5
4
  autoload :PageName
6
5
  end
@@ -21,7 +21,6 @@ module Lalala::ExtActiveRecord::I18nTranslationsWriter
21
21
  _locale = I18n.locale
22
22
 
23
23
  I18n.available_locales.each do |locale|
24
- next if Rails.application.config.lalala.i18n.excluded_locales.try(:include?, locale)
25
24
  I18n.locale = locale
26
25
  attrs = attributes[locale.to_s]
27
26
  if attrs
@@ -3,5 +3,4 @@ module Lalala::ExtActiveRecord
3
3
 
4
4
  autoload :Schema
5
5
  autoload :I18nTranslationsWriter
6
- autoload :Assets
7
6
  end
@@ -31,7 +31,6 @@ module Lalala::ExtI18n::InputHelper
31
31
  ].flatten.compact
32
32
 
33
33
  locales.each do |locale|
34
- next if Rails.application.config.lalala.i18n.excluded_locales.try(:include?, locale)
35
34
  I18n.locale = locale
36
35
  @object_name = "#{_object_name}[translations_writer][#{locale}]"
37
36
 
@@ -28,8 +28,4 @@ class Lalala::ExtI18n::NegotiationAdapter
28
28
  %r{^/(lalala|assets)(/|$)} === env['PATH_INFO']
29
29
  end
30
30
 
31
- def allow_accept_language
32
- !!Rails.configuration.lalala.i18n.allow_accept_language
33
- end
34
-
35
31
  end
@@ -18,8 +18,4 @@ class Lalala::ExtI18n::TestNegotiationAdapter < Lalala::ExtI18n::NegotiationAdap
18
18
  @domain_locales[hostname]
19
19
  end
20
20
 
21
- def allow_accept_language
22
- true
23
- end
24
-
25
21
  end
@@ -63,15 +63,13 @@ private
63
63
  return action(true)
64
64
  end
65
65
 
66
- if @adapter.allow_accept_language
67
- Rails.logger.debug "[I18n]: try Accept-Language..."
68
- if m = accept_language_is_available?
69
- @env['rack.locale'] = m[0]
70
- @env['SCRIPT_NAME'] = m[1]
71
- @env['lalala.cannonical_url'] = m[2]
72
- @env['lalala.locale.source'] = 'header'
73
- return action(false)
74
- end
66
+ Rails.logger.debug "[I18n]: try Accept-Language..."
67
+ if m = accept_language_is_available?
68
+ @env['rack.locale'] = m[0]
69
+ @env['SCRIPT_NAME'] = m[1]
70
+ @env['lalala.cannonical_url'] = m[2]
71
+ @env['lalala.locale.source'] = 'header'
72
+ return action(false)
75
73
  end
76
74
 
77
75
  @env['rack.locale'] = default_locale_for_hostname.to_sym
@@ -0,0 +1,24 @@
1
+ class Lalala::Markdown::Handlers::Asset < Lalala::Markdown::Handlers::Base
2
+
3
+ def initialize(options={})
4
+ @options = options
5
+ end
6
+
7
+ def image(url, alt=nil, title=nil)
8
+ unless %r|^asset[:]//(.+)$| === url
9
+ return ""
10
+ end
11
+
12
+ id_with_version = $1.split("/")
13
+ id = id_with_version[0]
14
+ version = id_with_version[1] || "original"
15
+
16
+ url = "//" + File.join(
17
+ "c." + Haraway.configuration.endpoint,
18
+ id,
19
+ version.to_s)
20
+
21
+ "<img src=\"#{url}\" alt=\"#{alt}\" title=\"#{title}\" />"
22
+ end
23
+
24
+ end
@@ -18,19 +18,15 @@ class Lalala::Markdown::Handlers::YouTube < Lalala::Markdown::Handlers::Base
18
18
 
19
19
  id = $1
20
20
 
21
- helpers.content_tag :span, class: "embed-container is-youtube" do
22
- helpers.content_tag(
23
- :iframe,
24
- "",
25
- width: @options[:width],
26
- height: @options[:height],
27
- src: "//www.youtube.com/embed/#{id}?rel=0",
28
- frameborder: 0,
29
- allowfullscreen: true
30
- )
31
- end
32
-
33
-
21
+ helpers.content_tag(
22
+ :iframe,
23
+ "",
24
+ width: @options[:width],
25
+ height: @options[:height],
26
+ src: "http://www.youtube.com/embed/#{id}?rel=0",
27
+ frameborder: 0,
28
+ allowfullscreen: true
29
+ )
34
30
  end
35
31
 
36
32
  end
@@ -1,6 +1,6 @@
1
1
  class Lalala::Markdown::HtmlRenderer < Redcarpet::Render::HTML
2
2
 
3
- URI_PATTERN = %r{\A(lalala|youtube|vimeo|soundcloud)[:][/]{2}.+\Z}
3
+ URI_PATTERN = %r{\A(lalala|youtube|vimeo|asset)[:][/]{2}.+\Z}
4
4
 
5
5
  def initialize(options)
6
6
  @options = options.dup
@@ -57,7 +57,7 @@ class Lalala::Markdown::HtmlRenderer < Redcarpet::Render::HTML
57
57
  end
58
58
 
59
59
  options = (@options[:link_attributes] || {}).merge(title: title)
60
- helpers.link_to(content.html_safe, link, options)
60
+ helpers.link_to(content, link, options)
61
61
  end
62
62
 
63
63
  def enhanced_autolink(scheme, link, link_type)
@@ -8,9 +8,8 @@ class Lalala::Markdown
8
8
 
9
9
  module Handlers
10
10
  require 'lalala/markdown/handlers/base'
11
+ require 'lalala/markdown/handlers/asset'
11
12
  require 'lalala/markdown/handlers/youtube'
12
- require 'lalala/markdown/handlers/vimeo'
13
- require 'lalala/markdown/handlers/soundcloud'
14
13
  end
15
14
 
16
15
  PARSER_OPTIONS = [
@@ -45,7 +44,7 @@ class Lalala::Markdown
45
44
  @parser_options = options.slice(*PARSER_OPTIONS)
46
45
  @parser_options = {
47
46
  no_intra_emphasis: true,
48
- tables: true,
47
+ tables: false,
49
48
  fenced_code_blocks: true,
50
49
  autolink: true,
51
50
  strikethrough: true,
@@ -2,15 +2,9 @@ class AppBuilder < Rails::AppBuilder
2
2
  include Thor::Actions
3
3
  include Thor::Shell
4
4
 
5
- RUBY_VERSION = "2.1.7"
6
- LALALA_VERSION = "4.0.0.dev"
7
-
8
- # You can test the generator locally by pointing to your local gems:
9
- #
10
- # gem 'lalala', path: "~/Github/mrhenry/lalala-ng"
11
- # gem 'lalala-development', path: "~/Github/mrhenry/lalala-ng", groups: [:development]
12
- # gem 'lalala-assets', path: "~/Github/mrhenry/lalala-ng", groups: [:development, :assets]
13
- # gem 'lalala-test', path: "~/Github/mrhenry/lalala-ng", groups: [:test]
5
+ RUBY_VERSION = "2.0.0"
6
+ LALALA_VERSION = "4.1.0.dev"
7
+
14
8
  def gemfile
15
9
  create_file 'Gemfile', <<-DOC
16
10
 
@@ -1,6 +1,6 @@
1
1
  module Lalala
2
- VERSION = "4.0.0"
3
- BUILD = "416"
2
+ VERSION = "4.1.0"
3
+ BUILD = "299"
4
4
 
5
5
  if BUILD != ("{{BUILD_NUMBER" + "}}") # prevent sed replacement (see script/ci)
6
6
  BUILD_VERSION = "#{VERSION}.dev.#{BUILD}"
data/lib/lalala.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Lalala
2
2
 
3
- unless RUBY_VERSION == "2.1.7"
4
- raise "Lalala is only compatible with one version of ruby at a time (current: Ruby 2.1.7)"
3
+ unless RUBY_VERSION == "2.0.0"
4
+ raise "Lalala is only compatible with one version of ruby at a time (current: Ruby 2.0.0)"
5
5
  end
6
6
 
7
7
  require 'lalala/version'
@@ -12,18 +12,18 @@ module Lalala
12
12
 
13
13
  groups = Rails.groups(:assets => %w(development test)).map(&:to_sym)
14
14
 
15
+ require 'sentry-raven'
15
16
  require 'rails-i18n'
16
17
  require 'i18n-country-translations'
17
- require 'carrierwave'
18
18
  require 'closure_tree'
19
19
  require 'globalize3'
20
20
  require 'jquery-rails'
21
21
  require 'meta_search'
22
- require 'mini_magick'
23
22
  require 'redcarpet'
24
23
  require 'stringex'
25
24
  require 'country-select'
26
25
  require 'activeadmin'
26
+ require 'haraway'
27
27
 
28
28
  if groups.include?(:assets)
29
29
  require 'lalala/assets'
@@ -37,8 +37,8 @@ module Lalala
37
37
  require 'lalala/test'
38
38
  end
39
39
 
40
- require 'formtastic/inputs/grid_input'
41
- require 'formtastic/inputs/single_file_input'
40
+ require 'formtastic/inputs/haraway_input'
41
+ require 'formtastic/form_builder_ext'
42
42
 
43
43
  autoload :ExtActionDispatch
44
44
  autoload :ExtActiveRecord
@@ -48,7 +48,6 @@ module Lalala
48
48
 
49
49
  autoload :Markdown
50
50
  autoload :Pages
51
- autoload :Uploaders
52
51
  autoload :Cache
53
52
 
54
53
  module Core
data/script/ci CHANGED
@@ -41,54 +41,57 @@ if [[ "$TRAVIS_SECURE_ENV_VARS" == "true" && "$TRAVIS_PULL_REQUEST" == "false" ]
41
41
  then
42
42
 
43
43
  # Are we in the canonical environment?
44
- if [[ "$TRAVIS_BRANCH" == "master" && "$DB" == "postgresql" ]]
44
+ if [[ "$DB" == "postgresql" ]]
45
45
  then
46
+ if [[ "$TRAVIS_BRANCH" == "master" || "$TRAVIS_BRANCH" == "haraway" ]]
47
+ then
46
48
 
47
- announce "${yellow}" "Build development gems"
49
+ announce "${yellow}" "Build development gems"
48
50
 
49
- export LALALA_BUILD_VERSION="$TRAVIS_BUILD_NUMBER"
51
+ export LALALA_BUILD_VERSION="$TRAVIS_BUILD_NUMBER"
50
52
 
51
- { # set the build version
52
- cd lib/lalala
53
- mv version.rb version.rb_
54
- cat version.rb_ | sed "s|{{BUILD_NUMBER}}|$LALALA_BUILD_VERSION|" > version.rb
55
- rm version.rb_
56
- cd -
57
- } > /dev/null
53
+ { # set the build version
54
+ cd lib/lalala
55
+ mv version.rb version.rb_
56
+ cat version.rb_ | sed "s|{{BUILD_NUMBER}}|$LALALA_BUILD_VERSION|" > version.rb
57
+ rm version.rb_
58
+ cd -
59
+ } > /dev/null
58
60
 
59
61
 
60
- step "${yellow}" "Building lalala"
61
- rake lalala:build | indent
62
+ step "${yellow}" "Building lalala"
63
+ rake lalala:build | indent
62
64
 
63
- step "${yellow}" "Building lalala-assets"
64
- rake lalala-assets:build | indent
65
+ step "${yellow}" "Building lalala-assets"
66
+ rake lalala-assets:build | indent
65
67
 
66
- step "${yellow}" "Building lalala-development"
67
- rake lalala-development:build | indent
68
+ step "${yellow}" "Building lalala-development"
69
+ rake lalala-development:build | indent
68
70
 
69
- step "${yellow}" "Building lalala-test"
70
- rake lalala-test:build | indent
71
+ step "${yellow}" "Building lalala-test"
72
+ rake lalala-test:build | indent
71
73
 
72
74
 
73
- announce "${yellow}" "Release development gems"
75
+ announce "${yellow}" "Release development gems"
74
76
 
75
- mkdir -p "$HOME/.gem/"
76
- echo -e "---\n:rubygems_api_key: ${RUBYGEMS_API_KEY}" > "$HOME/.gem/credentials"
77
- chmod 0600 "$HOME/.gem/credentials"
77
+ mkdir -p "$HOME/.gem/"
78
+ echo -e "---\n:rubygems_api_key: ${RUBYGEMS_API_KEY}" > "$HOME/.gem/credentials"
79
+ chmod 0600 "$HOME/.gem/credentials"
78
80
 
79
- step "${yellow}" "Releasing lalala"
80
- gem push pkg/lalala-[0-9]*.gem | indent
81
+ step "${yellow}" "Releasing lalala"
82
+ gem push pkg/lalala-[0-9]*.gem | indent
81
83
 
82
- step "${yellow}" "Releasing lalala-assets"
83
- gem push pkg/lalala-assets-[0-9]*.gem | indent
84
+ step "${yellow}" "Releasing lalala-assets"
85
+ gem push pkg/lalala-assets-[0-9]*.gem | indent
84
86
 
85
- step "${yellow}" "Releasing lalala-development"
86
- gem push pkg/lalala-development-[0-9]*.gem | indent
87
+ step "${yellow}" "Releasing lalala-development"
88
+ gem push pkg/lalala-development-[0-9]*.gem | indent
87
89
 
88
- step "${yellow}" "Releasing lalala-test"
89
- gem push pkg/lalala-test-[0-9]*.gem | indent
90
+ step "${yellow}" "Releasing lalala-test"
91
+ gem push pkg/lalala-test-[0-9]*.gem | indent
90
92
 
91
93
 
94
+ fi
92
95
  fi
93
96
 
94
97
  fi