winton-app_helpers 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. metadata +26 -5
  2. data/MIT-LICENSE +0 -20
  3. data/README.markdown +0 -108
  4. data/init.rb +0 -7
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: winton-app_helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Winton Welsh
@@ -23,12 +23,33 @@ extra_rdoc_files: []
23
23
 
24
24
  files:
25
25
  - init.rb
26
- - lib/*
27
- - lib/**/*
26
+ - lib/app_helpers
27
+ - lib/app_helpers.rb
28
+ - lib/app_helpers/partials.rb
29
+ - lib/app_helpers/tbl.rb
30
+ - lib/app_helpers/truncate.rb
28
31
  - MIT-LICENSE
29
32
  - README.markdown
30
- - resources/**/*
31
- - tasks/*
33
+ - resources/views
34
+ - resources/views/tbl
35
+ - resources/views/tbl/_cell.haml
36
+ - resources/views/tbl/_row.haml
37
+ - resources/views/template
38
+ - resources/views/template/_textarea.haml
39
+ - resources/views/_script_tag.haml
40
+ - resources/widgets
41
+ - resources/widgets/stylesheets
42
+ - resources/widgets/stylesheets/tbl.sass
43
+ - resources/widgets/javascripts
44
+ - resources/widgets/javascripts/template.js
45
+ - resources/widgets/javascripts/tbl.js
46
+ - resources/widgets/javascripts/2_mootools.more.1.2.js
47
+ - resources/widgets/javascripts/1_mootools.1.2.js
48
+ - resources/widgets/javascripts/element.js
49
+ - resources/widgets/javascripts/init.js
50
+ - tasks/git.rake
51
+ - tasks/app_helpers.rake
52
+ - tasks/db.rake
32
53
  has_rdoc: false
33
54
  homepage: http://github.com/winton/app_helpers
34
55
  post_install_message:
data/MIT-LICENSE DELETED
@@ -1,20 +0,0 @@
1
- Copyright (c) 2008 Winton Welsh <mail@wintoni.us>
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.markdown DELETED
@@ -1,108 +0,0 @@
1
- app_helpers
2
- ===========
3
-
4
- A collection of useful Rails application helpers and rake tasks.
5
-
6
-
7
- Installation
8
- ------------
9
-
10
- Add app_helper submodule
11
-
12
- git submodule add git://github.com:winton/app_helpers.git vendor/plugins/app_helpers
13
-
14
- Copy resources (**app/views/app_helpers**)
15
-
16
- rake app_helpers
17
-
18
-
19
- Rake Tasks
20
- ----------
21
-
22
- ### app_helpers
23
-
24
- Installs **app/views/app_helpers**, which includes a few partials required by `Tbl` and `Template`.
25
-
26
- ### db:config
27
-
28
- Prompts for a database name and generates **config/database.yml** for you.
29
-
30
- ### git:submodule
31
-
32
- Runs `git:submodule:update`, and `git:submodule:pull`.
33
-
34
- #### git:submodule:update
35
-
36
- git submodule init
37
- git submodule update
38
-
39
- #### git:submodule:pull
40
-
41
- Finds submodules in **app/widgets**, **config**, and **vendor/plugins** and runs
42
-
43
- git checkout master
44
- git pull
45
-
46
- on each.
47
-
48
-
49
- Partials
50
- --------
51
-
52
- ### Method: `block_to_partial(partial_name, options = {}, &block)`
53
-
54
- Sends the output of a block to a partial as the local variable `body`.
55
-
56
- Example:
57
-
58
- = block_to_partial 'some_partial', :locals => { :x => 0 } do
59
- Two local variables will be sent to the partial; 'x' (0) and 'body' (this text).
60
-
61
-
62
- ### Method: `script_tag_redirect_to(url)`
63
-
64
- Renders an HTML javascript tag with the code `window.location=url`.
65
-
66
-
67
- Tbl
68
- ---
69
-
70
- ### Method: `tbl(type, name, unit=:px, *widths, &block)`
71
-
72
- Uses the partials in **app/views/app_helpers/tbl** to generate CSS tables (rows of content with specific column widths).
73
-
74
- Include the following in your site-wide SASS:
75
-
76
- .row
77
- :overflow hidden
78
- .parent
79
- :float left
80
- :display block
81
-
82
- The view:
83
-
84
- - tbl :row, :your_identifier, :px, 100, 200, 300 do
85
- - tbl :cell, :your_identifier do
86
- Row 1, Cell 1
87
- - tbl :cell, :your_identifier do
88
- Row 1, Cell 2
89
- - tbl :cell, :your_identifier do
90
- Row 1, Cell 3
91
- - tbl :cell, :your_identifier do
92
- Row 2, Cell 1
93
- - tbl :cell, :your_identifier do
94
- Row 2, Cell 2
95
- - tbl :cell, :your_identifier do
96
- Row 2, Cell 3
97
-
98
- *Note*: Change `:px` to `'%'` for percentage widths.
99
-
100
- See [rails_widget](https://github.com/winton/rails_widget) for a javascript implementation of Tbl.
101
-
102
-
103
- Truncate
104
- --------
105
-
106
- ### Method: `better_truncate(text, length = 80, truncate_string = "...")`
107
-
108
- Like `truncate`, but does the job without cutting words in half.
data/init.rb DELETED
@@ -1,7 +0,0 @@
1
- require 'app_helpers'
2
-
3
- ActionView::Base.send :include, AppHelpers
4
- ActionController::Base.send :include, AppHelpers
5
- ActionController::Base.class_eval do
6
- public :render_to_string
7
- end