Module: Decidim::Dev
- Defined in:
- lib/decidim/dev.rb,
lib/decidim/dev/railtie.rb,
lib/decidim/dev/version.rb,
lib/decidim/dev/dummy_translator.rb
Overview
This holds the decidim-dev version.
Defined Under Namespace
Classes: DummyTranslator, Railtie
Class Method Summary collapse
-
.asset(name) ⇒ Object
Public: Finds an asset.
-
.dummy_app_path ⇒ Object
Public: Get the dummy application path and raises an error if it is not set.
-
.dummy_app_path=(path) ⇒ Object
Public: Sets the dummy application path for testing.
-
.install_tasks ⇒ Object
Public: add rake tasks.
-
.test_file(filename, content_type) ⇒ Object
Public: Returns a file for testing, just like file fields expect it.
- .version ⇒ Object
Class Method Details
.asset(name) ⇒ Object
Public: Finds an asset.
Returns a String with the path for a particular asset.
15 16 17 |
# File 'lib/decidim/dev.rb', line 15 def self.asset(name) File.(File.join(__dir__, "dev", "assets", name)) end |
.dummy_app_path ⇒ Object
Public: Get the dummy application path and raises an error if it is not set.
39 40 41 42 43 44 45 |
# File 'lib/decidim/dev.rb', line 39 def self.dummy_app_path unless @dummy_app_path raise StandardError, "Please, add Decidim::Dev::dummy_app_path = File.expand_path(File.join(\"..\", \"spec\", \"decidim_dummy_app\")) to\n your spec helper with the path to the generated dummy app" end @dummy_app_path end |
.dummy_app_path=(path) ⇒ Object
Public: Sets the dummy application path for testing.
path - A string value defining the path.
34 35 36 |
# File 'lib/decidim/dev.rb', line 34 def self.dummy_app_path=(path) @dummy_app_path = path end |
.install_tasks ⇒ Object
Public: add rake tasks
25 26 27 28 29 |
# File 'lib/decidim/dev.rb', line 25 def self.install_tasks Dir[File.join(__dir__, "../tasks/*.rake")].each do |file| load file end end |
.test_file(filename, content_type) ⇒ Object
Public: Returns a file for testing, just like file fields expect it
20 21 22 |
# File 'lib/decidim/dev.rb', line 20 def self.test_file(filename, content_type) Rack::Test::UploadedFile.new(asset(filename), content_type) end |
.version ⇒ Object
6 7 8 |
# File 'lib/decidim/dev/version.rb', line 6 def self.version "0.23.6" end |