Class: GovukPublishingComponents::ApplicationsPage

Inherits:
Object
  • Object
show all
Defined in:
app/models/govuk_publishing_components/applications_page.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(application) ⇒ ApplicationsPage



5
6
7
8
9
# File 'app/models/govuk_publishing_components/applications_page.rb', line 5

def initialize(application)
  @application = application
  @dir = get_directory
  @gemfilelock = get_gemfile
end

Instance Attribute Details

#sourceObject (readonly)

Returns the value of attribute source.



3
4
5
# File 'app/models/govuk_publishing_components/applications_page.rb', line 3

def source
  @source
end

Instance Method Details

#gem_versionObject



15
16
17
# File 'app/models/govuk_publishing_components/applications_page.rb', line 15

def gem_version
  parse_file(@gemfilelock, /govuk_publishing_components \(([^)>=~ ]+)\)/)
end

#readable_nameObject



11
12
13
# File 'app/models/govuk_publishing_components/applications_page.rb', line 11

def readable_name
  @application.gsub("-", " ").capitalize
end

#sass_versionObject



23
24
25
# File 'app/models/govuk_publishing_components/applications_page.rb', line 23

def sass_version
  parse_file(@gemfilelock, /sass-embedded \(([^)>=~ ]+)\)/)
end

#slimmer_versionObject



19
20
21
# File 'app/models/govuk_publishing_components/applications_page.rb', line 19

def slimmer_version
  parse_file(@gemfilelock, /slimmer \(([^)>=~ ]+)\)/)
end