Module: Decidim::Dev

Defined in:
decidim-dev/lib/decidim/dev.rb,
decidim-dev/app/controllers/concerns/decidim/dev/needs_development_tools.rb,
decidim-dev/lib/decidim/dev/engine.rb,
decidim-dev/lib/decidim/dev/railtie.rb,
decidim-dev/lib/decidim/dev/version.rb,
decidim-dev/lib/decidim/dev/dummy_translator.rb

Overview

This holds the decidim-dev version.

Defined Under Namespace

Modules: NeedsDevelopmentTools Classes: DummyTranslator, Engine, Railtie

Class Method Summary collapse

Class Method Details

.asset(name) ⇒ Object

Public: Finds an asset.

Returns a String with the path for a particular asset.


15
16
17
# File 'decidim-dev/lib/decidim/dev.rb', line 15

def self.asset(name)
  File.expand_path(File.join(__dir__, "dev", "assets", name))
end

.dummy_app_pathObject

Public: Get the dummy application path and raises an error if it is not set.


39
40
41
42
43
44
45
# File 'decidim-dev/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 'decidim-dev/lib/decidim/dev.rb', line 34

def self.dummy_app_path=(path)
  @dummy_app_path = path
end

.install_tasksObject

Public: add rake tasks


25
26
27
28
29
# File 'decidim-dev/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 'decidim-dev/lib/decidim/dev.rb', line 20

def self.test_file(filename, content_type)
  Rack::Test::UploadedFile.new(asset(filename), content_type)
end

.versionObject


6
7
8
# File 'decidim-dev/lib/decidim/dev/version.rb', line 6

def self.version
  "0.25.0.dev"
end