arfy 0.2 → 0.2.1

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.
@@ -1,22 +0,0 @@
1
- module RailsFaker
2
- module ApplicationFaker
3
- def config
4
- if @fake_config.nil?
5
- @fake_config = Object.new
6
- class << @fake_config
7
- include ConfigFaker
8
- end
9
- end
10
- @fake_config
11
- end
12
-
13
- def paths
14
- configured_paths
15
- end
16
-
17
- def load_seed
18
- seed_file = paths["db/seeds"]
19
- load(seed_file) if File.exist?(seed_file)
20
- end
21
- end
22
- end
@@ -1,13 +0,0 @@
1
- module RailsFaker
2
- #https://github.com/rails/rails/blob/master/railties/lib/rails/application/configuration.rb
3
- module ConfigFaker
4
- def paths
5
- configured_paths
6
- end
7
-
8
- def database_configuration
9
- @configuration ||= YAML::load(ERB.new(IO.read(paths["config/database"])).result)
10
- @configuration
11
- end
12
- end
13
- end
@@ -1,13 +0,0 @@
1
- module RailsFaker
2
- module EnvironmentFaker
3
- def method_missing(who_ami, *params)
4
- method = who_ami.to_s
5
- ends_with_questionmark = method.index("?") == method.length - 1
6
- if ends_with_questionmark
7
- env_name_asked = method.slice(0, method.length-1)
8
- return env_name_asked == ENV['RAILS_ENV'] || self.env
9
- end
10
- super
11
- end
12
- end
13
- end
@@ -1,7 +0,0 @@
1
- <%= "class #{klass} < ActiveRecord::Migration" %>
2
- <%= " def self.up" %>
3
- <%= " end" %>
4
- <%= "" %>
5
- <%= " def self.down" %>
6
- <%= " end" %>
7
- <%= "end" %>
@@ -1,25 +0,0 @@
1
- module RailsFaker
2
- def root
3
- "."
4
- end
5
-
6
- def env
7
- if @fake_env.nil?
8
- @fake_env = String.new(ENV['RAILS_ENV'] ||= "development")
9
- class << @fake_env
10
- include EnvironmentFaker
11
- end
12
- end
13
- @fake_env
14
- end
15
-
16
- def application
17
- if @fake_application.nil?
18
- @fake_application = Object.new
19
- class << @fake_application
20
- include ApplicationFaker
21
- end
22
- end
23
- @fake_application
24
- end
25
- end