Module: Decidim::Dev

Defined in:
lib/decidim/dev.rb,
lib/decidim/dev/railtie.rb,
lib/decidim/dev/version.rb

Overview

This holds the decidim-dev version.

Defined Under Namespace

Classes: 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.



13
14
15
# File 'lib/decidim/dev.rb', line 13

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.



37
38
39
40
41
42
43
# File 'lib/decidim/dev.rb', line 37

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.



32
33
34
# File 'lib/decidim/dev.rb', line 32

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

.install_tasksObject

Public: add rake tasks



23
24
25
26
27
# File 'lib/decidim/dev.rb', line 23

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



18
19
20
# File 'lib/decidim/dev.rb', line 18

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

.versionObject



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

def self.version
  "0.9.1"
end