espresso 0.0.9 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.9
1
+ 0.0.10
data/espresso.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{espresso}
8
- s.version = "0.0.9"
8
+ s.version = "0.0.10"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Alexander Semyonov"]
@@ -25,6 +25,7 @@ Gem::Specification.new do |s|
25
25
  "espresso.gemspec",
26
26
  "init.rb",
27
27
  "lib/espresso.rb",
28
+ "lib/espresso/helpers.rb",
28
29
  "lib/espresso/model.rb",
29
30
  "lib/espresso/objects_controller.rb",
30
31
  "test/espresso_test.rb",
@@ -0,0 +1,24 @@
1
+ module Espresso
2
+ module Helpers
3
+ inlude WillPaginate::ViewHelpers
4
+
5
+ def simple_search
6
+ form_tag(url_for(:action => :index), :method => :get, :class => 'b_search b_search-simple') do
7
+ inform = returning '' do |result|
8
+ result << text_field_tag(:q, params[:q])
9
+ result << submit_tag(t('krasivotokak.espresso.find', :default => 'Find!'), :class => 'submit')
10
+ end
11
+ concat inform
12
+ end
13
+ end
14
+
15
+ def will_paginate_with_i18n(collection, options = {})
16
+ will_paginate_without_i18n(collection,
17
+ options.merge({
18
+ :class => 'b_pagination',
19
+ :previous_label => t('krasivotokak.espresso.previous', :default => '← Previous'),
20
+ :next_label => t('krasivotokak.espresso.next', :default => 'Next →')}))
21
+ end
22
+ alias_method_chain :will_paginate, :i18n
23
+ end
24
+ end
data/lib/espresso.rb CHANGED
@@ -6,4 +6,5 @@ require 'espresso/model'
6
6
 
7
7
  if defined? Rails
8
8
  ActiveRecord::Base.send :include, Espresso::Model if defined? ActiveRecord
9
+ ActionView::Base.send :include, Espresso::Helpers if defined? ActionView
9
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: espresso
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Semyonov
@@ -70,6 +70,7 @@ files:
70
70
  - espresso.gemspec
71
71
  - init.rb
72
72
  - lib/espresso.rb
73
+ - lib/espresso/helpers.rb
73
74
  - lib/espresso/model.rb
74
75
  - lib/espresso/objects_controller.rb
75
76
  - test/espresso_test.rb