thematic 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 449212ed6179813cd5dbdcf4f385f8d494a68e81
4
- data.tar.gz: 4f90ff7035688cf9d4386f4bc996ab9572f24b67
3
+ metadata.gz: 309d0b7b0db7a88b303c326eb67d1400aecbc36a
4
+ data.tar.gz: 2ccf54ecc8fe90c1f2c709245ced7d0bb694cdc4
5
5
  SHA512:
6
- metadata.gz: c50cc05fdc65b389f75c15aa7da049dad5797a7f9e08d7e1c0c077baeda9d3d3d0a652f2b3460bb12fec8b09a417820b036b4abe9f1a01444ed0395f9491bacf
7
- data.tar.gz: b1488a54b1bb1da2898abc25c62bc71f0684104e6578bf2f64510cc433b6f05d56d00661dc5574b0c1024fb4cc900d4a4b9d8842e0b4c130323e737ca9eed9f2
6
+ metadata.gz: 126a52b86a10fc99e0325b22c7d7b5707406555bda92a8a985cbce223fe42c7070aa9e47d9aca04e8347c36ceb2e8439b91ec3f769efcd98c8f127d605e9ae7b
7
+ data.tar.gz: e313694cca0a25486181d2e008b713b04f092a00dea602c0a9cc29433e041a444a9b4e7ec7bf7cfdcc46a575af25e3de1fe6d9d9543411f49c202cd1f558ec66
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
@@ -3,7 +3,24 @@ require 'fileutils'
3
3
  namespace :thematic do
4
4
  desc "descriptions of the task"
5
5
  task :install, [:filepath] do |task, args|
6
- # args[:filepath] represent the path of the theme, which is inputed by the user
6
+
7
+ # There are a number of things that need to happen in order to install a theme properly
8
+ # into a Rails application. They are:
9
+ # 1. CSS, JS, fonts, and image files must all be copied over into the Rails app.
10
+ # CSS and JS files belong in the vendor/assets folders, while fonts and images will
11
+ # go into app/assets.
12
+ # 2. Anything inside vendor must be explicitly referenced by the application.css and
13
+ # application.js files under app/assets. Each and every file must be referenced.
14
+ # 3. Any time that an image url or font url is referenced inside CSS, it must be
15
+ # modified as follows: The css file must be given a .erb extension, and the url
16
+ # must be wrapped in erb with an asset path or font path.
17
+ # For example: url('images/picture.png')
18
+ # must be edited to: url('<%= asset_path("theme/picture.png") %>')
19
+ # and url('../fonts/fontawesome-webfont.eot?v=4.2.0')
20
+ # must be edited to: url('<%= font_path('theme/fontawesome-webfont.eot')%>?v=4.2.0')
21
+ # 4. Whenever an image is referenced inside HTML, an image_tag or image_path within
22
+ # erb must be used instead of the plain HTML.
23
+ # Currently, this gem accomplishes steps 1 - 3, and step 4 must be done manually.
7
24
 
8
25
  # CSS #################################
9
26
  puts "Installing CSS..."
@@ -17,7 +34,12 @@ namespace :thematic do
17
34
  FileUtils.remove_dir "vendor/assets/stylesheets/#{theme_subfolder}" if File.exist?("vendor/assets/stylesheets/#{theme_subfolder}")
18
35
  FileUtils.mkdir "vendor/assets/stylesheets/#{theme_subfolder}"
19
36
 
20
- file_to_edit = "app/assets/stylesheets/application.css"
37
+ if File.exist?("app/assets/stylesheets/application.css") # the default of older Rails versions
38
+ file_to_edit = "app/assets/stylesheets/application.css"
39
+ else
40
+ file_to_edit = "app/assets/stylesheets/application.scss"
41
+ end
42
+
21
43
  f = File.new(file_to_edit)
22
44
 
23
45
  tempfile = File.open("file.tmp", 'w')
@@ -139,6 +161,7 @@ namespace :thematic do
139
161
 
140
162
  f.each do |line|
141
163
  if line =~/background.*url/
164
+ # TODO: Some themes omit the quotation marks around the url
142
165
  image_filename = /("|').*("|')/.match(line)[0].split("#{images_folder}/").last.delete('"').delete("'")
143
166
  new_snippet = "(\"<%= asset_path('#{theme_subfolder}/#{image_filename}') %>\")"
144
167
  modified_line = line.gsub(/\(.*\)/, new_snippet)
@@ -1,3 +1,3 @@
1
1
  module Thematic
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thematic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jay Wengrow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-11 00:00:00.000000000 Z
11
+ date: 2015-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,6 +52,7 @@ files:
52
52
  - LICENSE.txt
53
53
  - README.md
54
54
  - Rakefile
55
+ - code_of_conduct.md
55
56
  - lib/thematic.rb
56
57
  - lib/thematic/tasks/thematic.rake
57
58
  - lib/thematic/version.rb