ez 0.8.7 → 0.9.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9fb3f7482e26d47daa8f2fbb7e68b44ea482a648
4
- data.tar.gz: 8afecf6f2000ba859ce5f670a2dcd7c5de6a5bd0
3
+ metadata.gz: 16c7b16c893b65e45e3261b8c9e71c7bf14da0c6
4
+ data.tar.gz: 546f01535e552ed763b5487176109c1b853f872a
5
5
  SHA512:
6
- metadata.gz: edcf5d5763aadeef8346d2406a038d51423baa2e22fefdc5c02160bf1dd576bd1e11c5bb873388b2798da4178e06e66d957c0d336321808fcad8540dc9a6b903
7
- data.tar.gz: c022c2cd92c17a1e3782edc350b6c2aa1c252fe2636883e2cfd2bcc1f0ea399e2d486b104ab3465849ded71b166b8e025b0836cc16b30b92d87c4d5ca404528c
6
+ metadata.gz: 3212cb743e5346d611dd94a02aaa798e1bce0f5939debd000e326d810ac3349a7e9c4fabfc8051e40054ce87bac8fc69dc7642e255e7ad49512ff8f61f3415fe
7
+ data.tar.gz: 06ee3f279e4d1b6385b026ba0e10b3c3b7335b6d324913072164d04b7fc6a35ffbcf80c7b081d8b7d9bb90ecff09bcc824db36b5ea3dc15c58e2ba477e0d589a
data/lib/ez.rb CHANGED
@@ -15,7 +15,7 @@ module EZ
15
15
  end
16
16
 
17
17
  console do
18
- Hirb.enable if defined?(Hirb)
18
+ Hirb.enable if Rails.env.development? && defined?(Hirb)
19
19
  # context.back_trace_limit = 0
20
20
 
21
21
  I18n.enforce_available_locales = false
@@ -53,18 +53,20 @@ module EZ
53
53
  # end
54
54
  # end
55
55
 
56
- module ::Hirb
57
- # A Formatter object formats an output object (using Formatter.format_output) into a string based on the views defined
58
- # for its class and/or ancestry.
59
- class Formatter
60
- def determine_output_class(output)
61
- if output.respond_to?(:to_a) && to_a_classes.any? {|e| output.is_a?(e) }
62
- Array(output)[0].class
63
- else
64
- if output.is_a?(ActiveRecord::Base)
65
- Hash
56
+ if Rails.env.development?
57
+ module ::Hirb
58
+ # A Formatter object formats an output object (using Formatter.format_output) into a string based on the views defined
59
+ # for its class and/or ancestry.
60
+ class Formatter
61
+ def determine_output_class(output)
62
+ if output.respond_to?(:to_a) && to_a_classes.any? {|e| output.is_a?(e) }
63
+ Array(output)[0].class
66
64
  else
67
- output.class
65
+ if output.is_a?(ActiveRecord::Base)
66
+ Hash
67
+ else
68
+ output.class
69
+ end
68
70
  end
69
71
  end
70
72
  end
@@ -85,7 +85,7 @@ module EZ
85
85
  end
86
86
  end
87
87
  filename = "app/models/#{model_name.underscore}.rb"
88
- unless File.exists?(filename)
88
+ unless Rails.env.production? || File.exists?(filename)
89
89
  display_change "Creating new model file: #{filename}"
90
90
  File.open(filename, "w") do |f|
91
91
  f.puts "class #{model_name} < ActiveRecord::Base"
@@ -139,10 +139,7 @@ module EZ
139
139
  end
140
140
 
141
141
  def connect_to_database
142
- ActiveRecord::Base.establish_connection({
143
- adapter: 'sqlite3',
144
- database: "db/development.sqlite3",
145
- })
142
+ ActiveRecord::Base.establish_connection
146
143
  @db = ActiveRecord::Base.connection
147
144
  end
148
145
 
@@ -1,3 +1,3 @@
1
1
  module EZ
2
- VERSION = "0.8.7"
2
+ VERSION = "0.9.0"
3
3
  end
@@ -29,7 +29,7 @@ EOS
29
29
  task :tables => :environment do
30
30
  if File.exists?('db/models.yml')
31
31
  EZ::DomainModeler.update_tables
32
- Rake::Task["db:schema:dump"].invoke
32
+ Rake::Task["db:schema:dump"].invoke unless Rails.env.production?
33
33
  else
34
34
  emit_help_page
35
35
  Rake::Task["ez:generate_yml"].invoke
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ez
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.7
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Cohen