Class: Awestruct::Compass::DefaultConfiguration

Inherits:
Compass::Configuration::Data
  • Object
show all
Defined in:
lib/awestruct/compass/default_configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(site) ⇒ DefaultConfiguration



9
10
11
# File 'lib/awestruct/compass/default_configuration.rb', line 9

def initialize site
  @site = site
end

Instance Attribute Details

#siteObject (readonly)

Returns the value of attribute site



7
8
9
# File 'lib/awestruct/compass/default_configuration.rb', line 7

def site
  @site
end

Instance Method Details

#default_cache_dirObject



125
126
127
# File 'lib/awestruct/compass/default_configuration.rb', line 125

def default_cache_dir
  File.join site.config.dir, '.sass-cache'
end

#default_css_dirObject



33
34
35
# File 'lib/awestruct/compass/default_configuration.rb', line 33

def default_css_dir
  File.join site.output_dir, 'stylesheets'
end

#default_environmentObject



17
18
19
# File 'lib/awestruct/compass/default_configuration.rb', line 17

def default_environment
  site.profile
end

#default_fonts_dirObject



73
74
75
# File 'lib/awestruct/compass/default_configuration.rb', line 73

def default_fonts_dir
  File.join site.config.dir, 'fonts'
end

#default_generated_images_dirObject



53
54
55
# File 'lib/awestruct/compass/default_configuration.rb', line 53

def default_generated_images_dir
  File.join site.output_dir, 'images'
end

#default_http_fonts_dirObject



77
78
79
# File 'lib/awestruct/compass/default_configuration.rb', line 77

def default_http_fonts_dir
  File.join http_path, 'fonts'
end

#default_http_generated_images_dirObject



57
58
59
# File 'lib/awestruct/compass/default_configuration.rb', line 57

def default_http_generated_images_dir
  File.join http_path, 'images'
end

#default_http_images_dirObject



69
70
71
# File 'lib/awestruct/compass/default_configuration.rb', line 69

def default_http_images_dir
  File.join http_path, 'images'
end

#default_http_javascripts_dirObject



41
42
43
# File 'lib/awestruct/compass/default_configuration.rb', line 41

def default_http_javascripts_dir
  File.join http_path, 'javascripts' 
end

#default_http_pathObject



29
30
31
# File 'lib/awestruct/compass/default_configuration.rb', line 29

def default_http_path
  site.base_url
end

#default_http_stylesheets_dirObject



45
46
47
# File 'lib/awestruct/compass/default_configuration.rb', line 45

def default_http_stylesheets_dir
  File.join http_path, 'stylesheets'
end

#default_images_dirObject



49
50
51
# File 'lib/awestruct/compass/default_configuration.rb', line 49

def default_images_dir
  File.join site.config.dir, 'images'
end

#default_images_pathObject



65
66
67
# File 'lib/awestruct/compass/default_configuration.rb', line 65

def default_images_path
  File.join project_path, 'images'
end

#default_javascripts_dirObject



37
38
39
# File 'lib/awestruct/compass/default_configuration.rb', line 37

def default_javascripts_dir
  File.join site.config.dir, 'javascripts'
end

#default_project_pathObject



21
22
23
# File 'lib/awestruct/compass/default_configuration.rb', line 21

def default_project_path
  site.config.dir
end

#default_project_typeObject



13
14
15
# File 'lib/awestruct/compass/default_configuration.rb', line 13

def default_project_type
  :stand_alone
end

#default_relative_assetsObject



121
122
123
# File 'lib/awestruct/compass/default_configuration.rb', line 121

def default_relative_assets
  false
end

#default_sass_dirObject



25
26
27
# File 'lib/awestruct/compass/default_configuration.rb', line 25

def default_sass_dir
  File.join site.config.dir, 'stylesheets'
end

#default_sprite_load_pathObject



61
62
63
# File 'lib/awestruct/compass/default_configuration.rb', line 61

def default_sprite_load_path
  [images_path]
end

#line_commentsObject



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/awestruct/compass/default_configuration.rb', line 81

def line_comments
  if self.inherited_data && self.inherited_data.is_a?(::Compass::Configuration::FileData)
    return self.inherited_data.line_comments
  end
  if site.profile.eql? 'production'
    return false
  else
    if site.key? :compass_line_comments
      return site.compass_line_comments 
    end
    if site.key?(:scss) && site.scss.key?(:line_comments)
      return site.scss.line_comments
    end
    if site.key?(:sass) && site.sass.key?(:line_comments)
      return site.sass.line_comments
    end
    true
  end
end

#output_styleObject



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/awestruct/compass/default_configuration.rb', line 101

def output_style
  if self.inherited_data && self.inherited_data.is_a?(::Compass::Configuration::FileData)
    return self.inherited_data.output_style
  end
  if site.profile.eql? 'production'
    return :compressed
  else
    if site.key? :compass_output_style
      return site.compass_output_style
    end
    if (site.key? :scss) && (site.scss.key? :style)
      return site.scss.style
    end
    if (site.key? :sass) && (site.sass.key? :style)
      return site.sass.style
    end
  end
  :expanded
end