kendoui-rails 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -5,4 +5,8 @@
5
5
  ## 0.0.3 (26 February 2012)
6
6
 
7
7
  - Added install generator for automatically adding kendoui JS and CSS files to projects
8
- - Added generator option to specify theme (default is default)
8
+ - Added generator option to specify theme (default is default)
9
+
10
+ ## 0.0.4 (27 February 2012)
11
+
12
+ - Modified install generator to auto-add asset declarations to `application.js` and `application.css` for Rails 3.1+ apps with the asset pipeline enabled. Pre 3.1 apps, as well as those with `config.assets.enabled = false` will have the appropriate files copied over to `public/javascripts` and `public/stylesheets`
data/README.md CHANGED
@@ -1,34 +1,70 @@
1
1
  # kendoui-rails
2
2
 
3
- Kendo UI For Rails!
3
+ [Kendo UI](http://www.kendoui.com) For Rails!
4
4
 
5
5
  This gem provides:
6
6
 
7
- * Kendo UI JavaScript (Minified Version of the Complete Web Suite)
7
+ * Kendo UI JavaScript (Minified Version of the Web Suite)
8
8
  * Kendo UI Styles (Common Styles and the Default Theme)
9
9
 
10
- ## Rails 3.1
10
+ ## Installation
11
11
 
12
- For Rails 3.1 and greater, the files will be added to the asset pipeline and available for you to use. These two lines will be added to the file `app/assets/javascripts/application.js` by default:
12
+ In your Gemfile, add this line:
13
+
14
+ gem "kendoui-rails"
15
+
16
+ Then, run `bundle install`.
17
+
18
+ After bundler completes, you can install the appropriate scripts by running the following command:
19
+
20
+ `rails generate kendoui:install`
21
+
22
+ Depending on your Rails version and environment, this command will either:
23
+ a) add javascripts and stylesheets to your asset pipeline (Rails 3.1+);
24
+ or, b) add javascripts and stylesheets to your `public/javascripts` and `public\stylesheets` folders (Rails < 3.1 and Rails 3.1+ with asset pipeline disabled).
25
+
26
+ ### Rails 3.1 (Asset Pipeline)
27
+
28
+ For Rails 3.1 and greater, Kendo UI will be added to the asset pipeline and available for you to use. This line will be added to the file `app/assets/javascripts/application.js` by default:
13
29
 
14
- //= require jquery
15
- //= require kendo/kendo.all.min
30
+ //= require kendo/kendo.all.min
16
31
 
17
- To work with Kendo UI Themes, you'll need to add the following to `app\assets\stylesheets\application.css`:
32
+ Appropriate styles will also be added to the asset pipeline, with the following two lines added to `app\assets\stylesheets\application.css`:
18
33
 
19
34
  *= require kendo/kendo.common.min
20
35
  *= require kendo/kendo.default.min
21
36
 
22
- If you prefer another theme (metro, silver, etc) replace the second line with the name of that theme
37
+ If you prefer another theme (metro, silver, etc) replace the second line with the name of that theme, or use the `--theme` switch in the generate command (see below for details).
23
38
 
24
- ### Installation
39
+ ### Rails 3.0, Previous or Asset Pipeline Disabled
25
40
 
26
- In your Gemfile, add this line:
41
+ For other environments, Kendo UI javascripts and styles will be added to the `public` folder for your application. After running `rails generate kendoui:install` you'll see the following in your public folder:
27
42
 
28
- gem "kendoui-rails"
43
+ + public
44
+ + javascripts
45
+ - kendo.all.min.js
46
+ + stylesheets
47
+ - kendo.common.min.css
48
+ - kendo.default.min.css
49
+
50
+ As with Rails 3.1 environments, the install generator will add the `kendo.default.min.css` stylesheet by default, and you can customize the installed theme with the `--theme` switch
29
51
 
30
- Then, run `bundle install`.
52
+ ### Customizing the Installed Theme
53
+
54
+ As mentioned above, the install generator will install the default (also named default) theme for Kendo UI, unless you specify an alternate with the generator command. This is done using the `--theme` switch. For example, if you wanted to install the 'metro' theme, you can run the following:
55
+
56
+ rails generate kendoui:install --theme:metro
57
+
58
+ ### Learn more about [Kendo UI](http://kendoui.com)!
59
+
60
+ Kendo UI is an end-to-end HTML5, CSS3 and JavaScript solution for modern client-side development, developed by [Telerik](http://www.telerik.com). For more information about Kendo UI, including documentation, support, and additional Kendo UI libraries like DataViz and Mobile, visit http://KendoUI.com and http://demos.kendoui.com/. Also, be sure to check out the [Kendo UI Blog](http://www.kendoui.com/blogs.aspx) for breaking Kendo UI news as well as mobile development tips and commentary.
61
+
62
+ You can also find Kendo UI on:
63
+
64
+ * [Twitter](https://twitter.com/#!/KendoUI)
65
+ * [Facebook](http://www.facebook.com/KendoUI)
66
+ * [Google+](https://plus.google.com/117798269023828336983/posts)
31
67
 
32
- That's all you need to start using Kendo UI.
68
+ Note: This gem provides a GPLv3 Licensed version of Kendo UI Core with full source code and access to major updates. For more information about commercial licenses for Kendo UI, as well as access to DataViz and Mobile suites, head over to the [Get Kendo UI](http://www.kendoui.com/blogs.aspx) page.
33
69
 
34
- Note: This gem provides a GPLv3 Licensed version of Kendo UI Core. For more information about Kendo UI, including documentation, support, and additional Kendo UI libraries like DataViz and Mobile, visit http://KendoUI.com
70
+ This gem was created by [Brandon Satrom](http://twitter.com/brandonsatrom). Find me online at [userinexperince.com](http://userinexperince.com) or on Twitter as [@BrandonSatrom](http://twitter.com/brandonsatrom). You can also email me at [brandon@kendoui.com](mailto:brandon@kendoui.com).
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
7
7
  s.version = Kendoui::Rails::VERSION
8
8
  s.authors = ["Brandon Satrom"]
9
9
  s.email = ["brandon@kendoui.com"]
10
- s.homepage = "http://github.com/bsatrom/kendoui-rails"
10
+ s.homepage = "http://github.com/bsatrom/kendoui_rails"
11
11
  s.summary = %q{Gem for Adding Kendo UI to Ruby Applications}
12
12
  s.description = %q{Adds GPLv3 Portions of Kendo UI (http://kendoui.com) to javascripts and styles folders}
13
13
 
@@ -1,6 +1,6 @@
1
1
  module Kendoui
2
2
  module Rails
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  KENDOUI_VERSION = "2011.3.1129"
5
5
  end
6
6
  end
@@ -1,25 +1,51 @@
1
1
  require 'rails'
2
2
  require File.expand_path('../../../../../../lib/kendoui-rails/version', __FILE__)
3
3
 
4
- module Kendoui
5
- module Generators
6
- class InstallGenerator < ::Rails::Generators::Base
4
+ if ::Rails.version < "3.1" || !::Rails.application.config.assets.enabled
5
+ module Kendoui
6
+ module Generators
7
+ class InstallGenerator < ::Rails::Generators::Base
7
8
 
8
- desc "This generator installs KendoUI #{Kendoui::Rails::KENDOUI_VERSION}"
9
- class_option :theme, :type => :string, :default => "default", :desc => "Kendo UI Theme to install"
10
- source_root File.expand_path('../../../../../../vendor/assets/', __FILE__)
11
-
12
- def copy_kendoui
13
- say_status("copying", "Kendo UI (#{Kendoui::Rails::KENDOUI_VERSION}) javascripts", :green)
9
+ desc "This generator installs KendoUI #{Kendoui::Rails::KENDOUI_VERSION}"
10
+ class_option :theme, :type => :string, :default => "default", :desc => "Kendo UI Theme to install"
14
11
 
15
- copy_file "javascripts/kendo/kendo.all.min.js", "public/javascripts/kendo.all.min.js"
12
+ source_root File.expand_path('../../../../../../vendor/assets/', __FILE__)
13
+
14
+ def copy_kendoui_scripts
15
+ say_status("copying", "Kendo UI (#{Kendoui::Rails::KENDOUI_VERSION}) javascripts", :green)
16
+
17
+ copy_file "javascripts/kendo/kendo.all.min.js", "public/javascripts/kendo.all.min.js"
18
+ end
19
+
20
+ def copy_kendoui_styles
21
+ say_status("copying", "Kendo UI (#{Kendoui::Rails::KENDOUI_VERSION}) stylesheets", :green)
22
+
23
+ copy_file "stylesheets/kendo/kendo.common.min.css", "public/stylesheets/kendo.common.min.css"
24
+ copy_file "stylesheets/kendo/kendo.#{options.theme}.min.css", "public/stylesheets/kendo.#{options.theme}.min.css"
25
+ end
16
26
  end
17
-
18
- def copy_kendoui_styles
19
- say_status("copying", "Kendo UI (#{Kendoui::Rails::KENDOUI_VERSION}) stylesheets", :green)
27
+ end
28
+ end
29
+ else
30
+ module Kendoui
31
+ module Generators
32
+ class InstallGenerator < ::Rails::Generators::Base
33
+ desc "This generator installs KendoUI #{Kendoui::Rails::KENDOUI_VERSION}"
34
+ class_option :theme, :type => :string, :default => "default", :desc => "Kendo UI Theme to install"
35
+
36
+ source_root File.expand_path("../../../../../../vendor/assets/", __FILE__)
20
37
 
21
- copy_file "stylesheets/kendo/kendo.common.min.css", "public/stylesheets/kendo.common.min.css"
22
- copy_file "stylesheets/kendo/kendo.#{options.theme}.min.css", "public/stylesheets/kendo.#{options.theme}.min.css"
38
+ def add_kendoui_scripts
39
+ say_status("adding", "Kendo UI (#{Kendoui::Rails::KENDOUI_VERSION}) to javascripts pipeline", :green)
40
+
41
+ insert_into_file "app/assets/javascripts/application.js", "//= require kendo/kendo.all.min\n", :before => "//= require_tree ."
42
+ end
43
+
44
+ def add_kendoui_styles
45
+ say_status("adding", "Kendo UI (#{Kendoui::Rails::KENDOUI_VERSION}) to styles pipeline", :green)
46
+
47
+ insert_into_file "app/assets/stylesheets/application.css", "*= require kendo/kendo.common.min\n *= require kendo/kendo.#{options.theme}.min\n ", :before => "*= require_self"
48
+ end
23
49
  end
24
50
  end
25
51
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kendoui-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-26 00:00:00.000000000 Z
12
+ date: 2012-02-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jquery-rails
16
- requirement: &70138515171260 !ruby/object:Gem::Requirement
16
+ requirement: &70302667368560 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70138515171260
24
+ version_requirements: *70302667368560
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rspec
27
- requirement: &70138515175380 !ruby/object:Gem::Requirement
27
+ requirement: &70302667367500 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70138515175380
35
+ version_requirements: *70302667367500
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rails
38
- requirement: &70138514834820 !ruby/object:Gem::Requirement
38
+ requirement: &70302667366580 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: 3.1.1
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70138514834820
46
+ version_requirements: *70302667366580
47
47
  description: Adds GPLv3 Portions of Kendo UI (http://kendoui.com) to javascripts and
48
48
  styles folders
49
49
  email:
@@ -499,7 +499,7 @@ files:
499
499
  - vendor/assets/stylesheets/kendo/kendo.silver.min.css
500
500
  - vendor/assets/stylesheets/kendo/textures/glass.png
501
501
  - vendor/assets/stylesheets/kendo/textures/highlight.png
502
- homepage: http://github.com/bsatrom/kendoui-rails
502
+ homepage: http://github.com/bsatrom/kendoui_rails
503
503
  licenses: []
504
504
  post_install_message:
505
505
  rdoc_options: []