dryink 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -5,11 +5,30 @@ rescue LoadError
5
5
  puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
6
  end
7
7
 
8
+ require 'rake'
8
9
  require 'rake/rdoctask'
9
10
 
11
+ $LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
12
+ require 'dryink/version'
13
+
14
+ task :build do
15
+ system "gem build dryink.gemspec"
16
+ end
17
+
18
+ task :install => :build do
19
+ system "gem install dryink-#{DryInk::VERSION}.gem"
20
+ end
21
+
22
+ task :release => :build do
23
+ system "git tag -a #{DryInk::VERSION} -m 'Tagging #{DryInk::VERSION}'"
24
+ system "git push --tags"
25
+ system "gem push dryink-#{DryInk::VERSION}.gem"
26
+ system "rm dryink-#{DryInk::VERSION}.gem"
27
+ end
28
+
10
29
  Rake::RDocTask.new(:rdoc) do |rdoc|
11
30
  rdoc.rdoc_dir = 'rdoc'
12
- rdoc.title = 'Dryink'
31
+ rdoc.title = 'DryInk'
13
32
  rdoc.options << '--line-numbers' << '--inline-source'
14
33
  rdoc.rdoc_files.include('README.rdoc')
15
34
  rdoc.rdoc_files.include('lib/**/*.rb')
@@ -0,0 +1,4 @@
1
+ = simple_form_for (@parent_object ? [@parent_object, @object] : @object) do |f|
2
+ - @fields.each do |k, v|
3
+ = f.input k, v
4
+ = f.submit (@object.persisted? ? "Save #{@model_singular}" : "Create #{@model_singular}")
@@ -0,0 +1,5 @@
1
+ %hgroup
2
+ %h1= "Edit #{@model_singular}"
3
+ %h2= @object_name
4
+
5
+ = render 'dryink/template/form'
@@ -0,0 +1,26 @@
1
+ %h1= @model_plural
2
+
3
+ %table.data
4
+ %thead
5
+ %tr
6
+ - @fields.each do |k, v|
7
+ %th= k.to_s.humanize
8
+ - if @objects.blank?
9
+ %tr
10
+ %td{:colspan => @fields.length}
11
+ %p= "No #{@model_plural} Found!"
12
+ - @objects.each do |r|
13
+ %tr
14
+ - f = 0
15
+ - @fields.each do |k, v|
16
+ - f += 1
17
+ - if f == 1
18
+ %td= link_to r[k], (@parent_object ? [@parent_object, r] : [r])
19
+ - else
20
+ %td= r[k]
21
+
22
+ = paginate @objects unless @skip_pagination
23
+
24
+ %p
25
+ - if can? :create, @model_class
26
+ = link_to "New #{@model_singular}", (@parent_object ? [:new, @parent_object, @model_symbol_singular] : [:new, @model_symbol_singular]), :class => 'button'
@@ -0,0 +1,3 @@
1
+ %h1= "New #{@model_singular}"
2
+
3
+ = render 'dryink/template/form'
@@ -0,0 +1,14 @@
1
+ %hgroup
2
+ %h1= @object_name
3
+ %h2= @model_singular
4
+
5
+ - @fields.each do |k,v|
6
+ %p
7
+ %strong= "#{v[:label]}:"
8
+ = @object[k]
9
+
10
+ %p
11
+ - if can? :edit, @object
12
+ = link_to "Edit #{@model_singular}", (@parent_object ? [:edit, @parent_object, @object] : [:edit, @object]), :class => 'button'
13
+ - if can? :delete, @object
14
+ = link_to "Delete #{@model_singular}", (@parent_object ? [@parent_object, @object] : [:edit, @object]), :class => 'button', :method => 'delete'
@@ -0,0 +1,3 @@
1
+ module DryInk
2
+ VERSION = '0.0.2'
3
+ end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 1
9
- version: 0.0.1
8
+ - 2
9
+ version: 0.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jason Coene
@@ -14,12 +14,11 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-05-16 00:00:00 -04:00
17
+ date: 2011-05-17 00:00:00 -04:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rails
22
- prerelease: false
23
22
  requirement: &id001 !ruby/object:Gem::Requirement
24
23
  none: false
25
24
  requirements:
@@ -32,10 +31,10 @@ dependencies:
32
31
  - beta1
33
32
  version: 3.1.0.beta1
34
33
  type: :runtime
34
+ prerelease: false
35
35
  version_requirements: *id001
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: cancan
38
- prerelease: false
39
38
  requirement: &id002 !ruby/object:Gem::Requirement
40
39
  none: false
41
40
  requirements:
@@ -47,10 +46,10 @@ dependencies:
47
46
  - 4
48
47
  version: 1.6.4
49
48
  type: :runtime
49
+ prerelease: false
50
50
  version_requirements: *id002
51
51
  - !ruby/object:Gem::Dependency
52
52
  name: haml
53
- prerelease: false
54
53
  requirement: &id003 !ruby/object:Gem::Requirement
55
54
  none: false
56
55
  requirements:
@@ -62,10 +61,10 @@ dependencies:
62
61
  - 25
63
62
  version: 3.0.25
64
63
  type: :runtime
64
+ prerelease: false
65
65
  version_requirements: *id003
66
66
  - !ruby/object:Gem::Dependency
67
67
  name: kaminari
68
- prerelease: false
69
68
  requirement: &id004 !ruby/object:Gem::Requirement
70
69
  none: false
71
70
  requirements:
@@ -77,10 +76,10 @@ dependencies:
77
76
  - 0
78
77
  version: 0.11.0
79
78
  type: :runtime
79
+ prerelease: false
80
80
  version_requirements: *id004
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: simple_form
83
- prerelease: false
84
83
  requirement: &id005 !ruby/object:Gem::Requirement
85
84
  none: false
86
85
  requirements:
@@ -92,8 +91,9 @@ dependencies:
92
91
  - 1
93
92
  version: 1.3.1
94
93
  type: :runtime
94
+ prerelease: false
95
95
  version_requirements: *id005
96
- description: DRY controller and views for your simple models.
96
+ description: A simple DRY template engine for Rails.
97
97
  email:
98
98
  - jcoene@gmail.com
99
99
  executables: []
@@ -103,8 +103,14 @@ extensions: []
103
103
  extra_rdoc_files: []
104
104
 
105
105
  files:
106
+ - app/views/dryink/template/_form.html.haml
107
+ - app/views/dryink/template/edit.html.haml
108
+ - app/views/dryink/template/index.html.haml
109
+ - app/views/dryink/template/new.html.haml
110
+ - app/views/dryink/template/show.html.haml
106
111
  - lib/dryink/base.rb
107
112
  - lib/dryink/engine.rb
113
+ - lib/dryink/version.rb
108
114
  - lib/dryink.rb
109
115
  - MIT-LICENSE
110
116
  - Rakefile
@@ -123,6 +129,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
123
129
  requirements:
124
130
  - - ">="
125
131
  - !ruby/object:Gem::Version
132
+ hash: -456271101227834846
126
133
  segments:
127
134
  - 0
128
135
  version: "0"
@@ -131,6 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
138
  requirements:
132
139
  - - ">="
133
140
  - !ruby/object:Gem::Version
141
+ hash: -456271101227834846
134
142
  segments:
135
143
  - 0
136
144
  version: "0"