hobo_ckeditor 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.9
1
+ 0.0.10
@@ -4,7 +4,7 @@ require 'hobo_rapid'
4
4
  require 'hobo_ck_editor'
5
5
  require 'hobo_ckeditor/types/ck_editor_text'
6
6
 
7
- module HoboCKEditor
7
+ module HoboCkeditor
8
8
 
9
9
  VERSION = File.read(File.expand_path('../../VERSION', __FILE__)).strip
10
10
 
@@ -42,12 +42,8 @@ module HoboCKEditor
42
42
  end
43
43
  end
44
44
 
45
- def self.divide_string_into_two_from_end(the_string, separator = ' ')
46
- the_string.split(separator)[-1].split().unshift(the_string.split(separator)[0..-2].join(separator))
47
- end
48
-
49
45
  def self.default_editor_settings()
50
- HoboCKEditor::DEFAULT_EDITOR_SETTINGS
46
+ HoboCkeditor::DEFAULT_EDITOR_SETTINGS
51
47
  end
52
48
 
53
49
  end
@@ -1,7 +1,7 @@
1
1
  require 'hobo_ck_editor'
2
2
  require 'rails'
3
3
 
4
- module HoboCKEditor
4
+ module HoboCkeditor
5
5
  class Railtie < Rails::Railtie
6
6
  end
7
7
  end
@@ -0,0 +1,8 @@
1
+ class string
2
+ def to_object_name_and_method_name
3
+ object_name, method_name = self.split(separator)[-1].split().unshift(self.split(separator)[0..-2].join(separator))
4
+ method_name.chomp(']') if method_name && !method_name.empty?
5
+ method_name, object_name = [object_name, 'this'] if !method_name
6
+ [object_name.to_sym, method_name.to_s]
7
+ end
8
+ end
@@ -1,6 +1,6 @@
1
1
  module HoboFields
2
2
  module Types
3
- class CKEditorText < HtmlString
3
+ class CkeditorText < HtmlString
4
4
  HoboFields.register_type(:cktext, self)
5
5
  end
6
6
  end
@@ -1,10 +1,9 @@
1
1
  <def tag="input" for="cktext" attribs="name, ckeditor">
2
2
  <%
3
- editor_settings = attributes['ckeditor'] || HoboCKEditor.default_editor_settings
4
- object_name, method_name = HoboCKEditor.divide_string_into_two_from_end(attributes['name'], '[')
5
- method_name = method_name.chomp(']') if method_name && !method_name.empty?
3
+ editor_settings = attributes['ckeditor'] || HoboCkeditor.default_editor_settings
4
+ object_name, method_name = attributes['name].to_object_name_and_method_name
6
5
  -%>
7
6
  <div class="cktextarea textarea">
8
- <%= cktext_area object_name.to_sym, method_name.to_sym, :ckeditor => editor_settings %>
7
+ <%= cktext_area object_name, method_name, :ckeditor => editor_settings %>
9
8
  </div>
10
9
  </def>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hobo_ckeditor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -77,6 +77,7 @@ files:
77
77
  - hobo_ckeditor.gemspec
78
78
  - lib/hobo_ck_editor.rb
79
79
  - lib/hobo_ckeditor/railtie.rb
80
+ - lib/hobo_ckeditor/string.rb
80
81
  - lib/hobo_ckeditor/types/ck_editor_text.rb
81
82
  - lib/tasks/hobo_ckeditor_tasks.rake
82
83
  - taglibs/hobo_ckeditor.dryml
@@ -135,7 +136,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
135
136
  version: '0'
136
137
  segments:
137
138
  - 0
138
- hash: -3673019969455985801
139
+ hash: 176577821033744729
139
140
  required_rubygems_version: !ruby/object:Gem::Requirement
140
141
  none: false
141
142
  requirements: