fume 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -9,7 +9,6 @@ begin
9
9
  gem.email = "Sunteya@gmail.com"
10
10
  gem.homepage = "http://github.com/sunteya/fume"
11
11
  gem.authors = ["Sunteya"]
12
- gem.add_development_dependency "authlogic"
13
12
  end
14
13
 
15
14
  Jeweler::GemcutterTasks.new
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :build:
3
3
  :minor: 2
4
- :patch: 4
4
+ :patch: 5
5
5
  :major: 0
data/fume.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{fume}
8
- s.version = "0.2.4"
8
+ s.version = "0.2.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Sunteya"]
12
- s.date = %q{2009-12-21}
12
+ s.date = %q{2009-12-24}
13
13
  s.email = %q{Sunteya@gmail.com}
14
14
  s.extra_rdoc_files = [
15
15
  "README"
@@ -56,9 +56,9 @@ Gem::Specification.new do |s|
56
56
  "generators/fume/simple_theme/templates/public/stylesheets/src/vendor/yui-3.0/base.css",
57
57
  "generators/fume/simple_theme/templates/public/stylesheets/src/vendor/yui-3.0/fonts.css",
58
58
  "generators/fume/simple_theme/templates/public/stylesheets/src/vendor/yui-3.0/reset.css",
59
- "init.rb",
60
59
  "lib/fume.rb",
61
60
  "lib/fume/authlogic.rb",
61
+ "lib/fume/formtastic.rb",
62
62
  "lib/fume/rails_ext.rb",
63
63
  "lib/fume/searchlogic.rb",
64
64
  "lib/fume/simple_theme.rb",
@@ -75,12 +75,9 @@ Gem::Specification.new do |s|
75
75
  s.specification_version = 3
76
76
 
77
77
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
78
- s.add_development_dependency(%q<authlogic>, [">= 0"])
79
78
  else
80
- s.add_dependency(%q<authlogic>, [">= 0"])
81
79
  end
82
80
  else
83
- s.add_dependency(%q<authlogic>, [">= 0"])
84
81
  end
85
82
  end
86
83
 
@@ -617,7 +617,10 @@ body {
617
617
  display: block;
618
618
  padding-bottom: 0.2em;
619
619
  }
620
- .formtastic ol .string input { display: inline; }
620
+ .formtastic ol .string input {
621
+ display: inline;
622
+ padding: 0.1em 0.2em;
623
+ }
621
624
  .formtastic ol .string .inline-hints {
622
625
  margin: 0 0 0 1em;
623
626
  font-style: italic;
@@ -630,7 +633,10 @@ body {
630
633
  display: block;
631
634
  padding-bottom: 0.2em;
632
635
  }
633
- .formtastic ol .select input { display: inline; }
636
+ .formtastic ol .select input {
637
+ display: inline;
638
+ padding: 0.1em 0.2em;
639
+ }
634
640
  .formtastic ol .select .inline-hints {
635
641
  margin: 0 0 0 1em;
636
642
  font-style: italic;
@@ -643,7 +649,10 @@ body {
643
649
  display: block;
644
650
  padding-bottom: 0.2em;
645
651
  }
646
- .formtastic ol .text input { display: inline; }
652
+ .formtastic ol .text input {
653
+ display: inline;
654
+ padding: 0.1em 0.2em;
655
+ }
647
656
  .formtastic ol .text .inline-hints {
648
657
  margin: 0 0 0 1em;
649
658
  font-style: italic;
@@ -656,7 +665,10 @@ body {
656
665
  display: block;
657
666
  padding-bottom: 0.2em;
658
667
  }
659
- .formtastic ol .numeric input { display: inline; }
668
+ .formtastic ol .numeric input {
669
+ display: inline;
670
+ padding: 0.1em 0.2em;
671
+ }
660
672
  .formtastic ol .numeric .inline-hints {
661
673
  margin: 0 0 0 1em;
662
674
  font-style: italic;
@@ -669,7 +681,10 @@ body {
669
681
  display: block;
670
682
  padding-bottom: 0.2em;
671
683
  }
672
- .formtastic ol .file input { display: inline; }
684
+ .formtastic ol .file input {
685
+ display: inline;
686
+ padding: 0.1em 0.2em;
687
+ }
673
688
  .formtastic ol .file .inline-hints {
674
689
  margin: 0 0 0 1em;
675
690
  font-style: italic;
@@ -682,13 +697,33 @@ body {
682
697
  display: block;
683
698
  padding-bottom: 0.2em;
684
699
  }
685
- .formtastic ol .password input { display: inline; }
700
+ .formtastic ol .password input {
701
+ display: inline;
702
+ padding: 0.1em 0.2em;
703
+ }
686
704
  .formtastic ol .password .inline-hints {
687
705
  margin: 0 0 0 1em;
688
706
  font-style: italic;
689
707
  display: inline;
690
708
  color: #888888;
691
709
  }
710
+ .formtastic ol .boolean label {
711
+ font-size: 1.2em;
712
+ color: #666666;
713
+ display: block;
714
+ padding-bottom: 0.2em;
715
+ }
716
+ .formtastic ol .boolean input {
717
+ display: inline;
718
+ padding: 0.1em 0.2em;
719
+ }
720
+ .formtastic ol .boolean .inline-hints {
721
+ margin: 0 0 0 1em;
722
+ font-style: italic;
723
+ display: inline;
724
+ color: #888888;
725
+ }
726
+ .formtastic ol .boolean label input { margin-right: 0.5em; }
692
727
  .formtastic ol .check_boxes fieldset .label label { font-size: 1.2em; }
693
728
  .formtastic ol .check_boxes fieldset ol li {
694
729
  float: left;
@@ -727,6 +762,25 @@ body {
727
762
  }
728
763
  .formtastic fieldset.buttons ol .commit input:hover { border: 1px solid #666666; }
729
764
  .formtastic fieldset.buttons ol .cancel a { color: #cc0000; }
765
+ .sidebar-block .formtastic { margin-right: 1em; }
766
+ .sidebar-block .formtastic .string input { width: 100%; }
767
+ .sidebar-block .formtastic .select input { width: 100%; }
768
+ .sidebar-block .formtastic .text input { width: 100%; }
769
+ .sidebar-block .formtastic .numeric input { width: 100%; }
770
+ .sidebar-block .formtastic .file input { width: 100%; }
771
+ .sidebar-block .formtastic .password input { width: 100%; }
772
+ .sidebar-block .formtastic .boolean input { width: 100%; }
773
+ .sidebar-block .formtastic fieldset.inputs {
774
+ border: none;
775
+ padding: 0;
776
+ margin: 0;
777
+ }
778
+ .sidebar-block .formtastic fieldset.buttons {
779
+ border: none;
780
+ padding: 0;
781
+ margin: 0;
782
+ }
783
+ .sidebar-block .formtastic fieldset.buttons li { margin-bottom: 0; }
730
784
  .form label.label { color: #666666; }
731
785
  .form input.text_field { border: 1px solid #cfcfcf; }
732
786
  .form textarea.text_area { border: 1px solid #cfcfcf; }
@@ -303,7 +303,7 @@ body {
303
303
  }
304
304
 
305
305
 
306
- .string, .select, .text, .numeric, .file, .password {
306
+ .string, .select, .text, .numeric, .file, .password, .boolean {
307
307
 
308
308
  label {
309
309
  font-size: 1.2em;
@@ -314,6 +314,7 @@ body {
314
314
 
315
315
  input {
316
316
  display: inline;
317
+ padding: 0.1em 0.2em;
317
318
  }
318
319
 
319
320
  .inline-hints {
@@ -324,6 +325,14 @@ body {
324
325
  }
325
326
  }
326
327
 
328
+ .boolean {
329
+ label {
330
+ input {
331
+ margin-right: 0.5em;
332
+ }
333
+ }
334
+ }
335
+
327
336
  .check_boxes {
328
337
  fieldset {
329
338
  .label label {
@@ -391,6 +400,33 @@ body {
391
400
  }
392
401
  }
393
402
 
403
+ .sidebar-block .formtastic {
404
+ margin-right: 1em;
405
+
406
+ .string, .select, .text, .numeric, .file, .password, .boolean {
407
+ input {
408
+ width: 100%;
409
+ }
410
+ }
411
+
412
+ fieldset.inputs {
413
+ border: none;
414
+ padding: 0;
415
+ margin: 0;
416
+ }
417
+
418
+ fieldset.buttons {
419
+ border: none;
420
+ padding: 0;
421
+ margin: 0;
422
+
423
+ li {
424
+ margin-bottom: 0;
425
+ }
426
+ }
427
+ }
428
+
429
+
394
430
  /* forms */
395
431
  .form {
396
432
  label.label {
@@ -1,8 +1,10 @@
1
1
  module Fume
2
2
  module Authlogic
3
3
  def self.enable
4
- ActionController::Base.send :include, ControllerExtensions::InstanceMethods
5
- ActionController::Base.send :helper_method, :current_user_session, :current_user
4
+ if defined? ::Authlogic
5
+ ActionController::Base.send :include, ControllerExtensions::InstanceMethods
6
+ ActionController::Base.send :helper_method, :current_user_session, :current_user
7
+ end
6
8
  end
7
9
 
8
10
  module ControllerExtensions
@@ -25,4 +27,6 @@ module Fume
25
27
  end
26
28
  end
27
29
  end
28
- end
30
+ end
31
+
32
+
@@ -0,0 +1,22 @@
1
+ module Fume
2
+ module Formtastic
3
+
4
+ def self.enable
5
+ return unless defined? ::Formtastic
6
+
7
+ ::Formtastic::SemanticFormBuilder.class_exec do
8
+ alias_method :humanized_attribute_name_without_instance, :humanized_attribute_name
9
+
10
+ def humanized_attribute_name(method)
11
+ if @object && @object.respond_to?(:human_attribute_name)
12
+ @object.human_attribute_name(method.to_s)
13
+ else
14
+ humanized_attribute_name_without_instance(method)
15
+ end
16
+ end
17
+ end
18
+
19
+ end
20
+ end
21
+ end
22
+
@@ -19,4 +19,3 @@ module Fume
19
19
  end
20
20
  end
21
21
 
22
-
@@ -2,15 +2,29 @@ module Fume
2
2
  module Searchlogic
3
3
 
4
4
  def self.enable
5
- ActionController::Base.send :helper, RailsHelpers
6
- ::Searchlogic::Search.send :include, SearchExtensions::InstanceMethods
5
+ if defined? ::Searchlogic
6
+ ActionController::Base.send :helper, RailsHelpers
7
+ ::Searchlogic::Search.send :include, SearchExtensions::InstanceMethods
8
+ end
7
9
  end
8
10
 
9
11
  module SearchExtensions
12
+ module ClassMethods
13
+ def human_name
14
+ "Search"
15
+ end
16
+ end
17
+
10
18
  module InstanceMethods
19
+ extend ClassMethods
20
+
11
21
  def human_attribute_name(name)
12
22
  klass.human_attribute_name(name)
13
23
  end
24
+
25
+ def new_record?
26
+ true
27
+ end
14
28
  end
15
29
  end
16
30
 
@@ -22,4 +36,5 @@ module Fume
22
36
  end
23
37
  end
24
38
  end
25
- end
39
+ end
40
+
data/lib/fume.rb CHANGED
@@ -2,23 +2,10 @@ require 'fume/authlogic'
2
2
  require 'fume/searchlogic'
3
3
  require 'fume/simple_theme'
4
4
  require 'fume/rails_ext'
5
-
6
- Fume::Authlogic.enable
7
- Fume::Searchlogic.enable
8
- Fume::SimpleTheme.enable
9
- Fume::RailsExt.enable
5
+ require 'fume/formtastic'
10
6
 
11
7
  module Fume
12
8
  def self.root
13
9
  @root ||= Pathname.new(File.dirname(__FILE__)).join("..")
14
10
  end
15
11
  end
16
-
17
- # if Object.const_defined? "Rake"
18
- # unless Rake::Task.task_defined? "fume"
19
- # rake_files = File.join(File.dirname(__FILE__), '..', 'tasks', '*.rake')
20
- # Dir[rake_files].each do |rake_file|
21
- # load rake_file
22
- # end
23
- # end
24
- # end
data/rails/init.rb CHANGED
@@ -1 +1,8 @@
1
- require "fume"
1
+ require File.join(File.dirname(__FILE__), *%w[.. lib fume])
2
+
3
+ ::Fume.constants.each do |module_name|
4
+ module_class = Fume.const_get(module_name)
5
+ if module_class.respond_to? :enable
6
+ module_class.enable
7
+ end
8
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fume
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sunteya
@@ -9,19 +9,10 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-21 00:00:00 +08:00
12
+ date: 2009-12-24 00:00:00 +08:00
13
13
  default_executable:
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: authlogic
17
- type: :development
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: "0"
24
- version:
14
+ dependencies: []
15
+
25
16
  description:
26
17
  email: Sunteya@gmail.com
27
18
  executables: []
@@ -72,9 +63,9 @@ files:
72
63
  - generators/fume/simple_theme/templates/public/stylesheets/src/vendor/yui-3.0/base.css
73
64
  - generators/fume/simple_theme/templates/public/stylesheets/src/vendor/yui-3.0/fonts.css
74
65
  - generators/fume/simple_theme/templates/public/stylesheets/src/vendor/yui-3.0/reset.css
75
- - init.rb
76
66
  - lib/fume.rb
77
67
  - lib/fume/authlogic.rb
68
+ - lib/fume/formtastic.rb
78
69
  - lib/fume/rails_ext.rb
79
70
  - lib/fume/searchlogic.rb
80
71
  - lib/fume/simple_theme.rb
data/init.rb DELETED
@@ -1,2 +0,0 @@
1
- require File.dirname(__FILE__) + "/rails/init.rb"
2
-