sass-tumblr 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +15 -0
- data/lib/sass_tumblr.rb +85 -0
- metadata +102 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: eb54b0d8dd6e225ba0e605c85c31d57cdc95f14f
|
4
|
+
data.tar.gz: 4542170588022e142cbff36676ea304bcc4533c8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3c90e15ae3a63bd4d41d9441f48f81ce33e08e65b9362c71dea7a69daac8425bd4f40b68ad5f599d4fcd9839c9019692653cd9d1c4a44deac0b4374228dd00ce
|
7
|
+
data.tar.gz: 2d6d3e23e9c3725969e2255ab94c5e6c23bd3e328c603b421e1b627d31667728a70e1f489ea15adbf6877ad7fc6f1d77778499f820b9dfc69a51d85a09e04ded
|
data/README.md
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
sass-tumblr
|
2
|
+
===========
|
3
|
+
|
4
|
+
Ignore [Tumblr template tags](https://www.tumblr.com/docs/en/custom_themes) like ``a { color: {color:Text}; }`` while parsing SCSS.
|
5
|
+
|
6
|
+
Usage
|
7
|
+
-----
|
8
|
+
|
9
|
+
Add dependency to your Gemfile.
|
10
|
+
|
11
|
+
gem "sass-tumblr"
|
12
|
+
|
13
|
+
Then require ``sass_tumblr`` in appropriate way.
|
14
|
+
|
15
|
+
require 'sass_tumblr'
|
data/lib/sass_tumblr.rb
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
require "sass"
|
2
|
+
|
3
|
+
module Sass
|
4
|
+
module SCSS
|
5
|
+
module RX
|
6
|
+
# Pattern to match Tumblr tag.
|
7
|
+
TUMBLR_VAR = /({[a-zA-Z0-9_]+(?::[a-zA-Z0-9_]+)?})/
|
8
|
+
end
|
9
|
+
|
10
|
+
# See lib/sass/scss/static_parser.rb
|
11
|
+
class StaticParser
|
12
|
+
# Handle Tumblr variable tags in CSS selector
|
13
|
+
# Used from CssParser directly, from StaticParser and Parser via RuleNode#try_to_parse_non_interpolated_rules.
|
14
|
+
alias :qualified_name_without_tumblr :qualified_name
|
15
|
+
def qualified_name(allow_star_name = false)
|
16
|
+
if var = tok(TUMBLR_VAR)
|
17
|
+
return nil, var
|
18
|
+
else
|
19
|
+
qualified_name_without_tumblr(allow_star_name)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
# Handle Tumblr variable tags in CSS key
|
24
|
+
# Used from CssParser and StaticParser
|
25
|
+
# This is needed even we've patched in Parser class since it's also overridden in StaticParser.
|
26
|
+
alias :interp_ident_without_tumblr :interp_ident
|
27
|
+
def interp_ident(ident = IDENT)
|
28
|
+
if var = tok(TUMBLR_VAR)
|
29
|
+
[var]
|
30
|
+
else
|
31
|
+
interp_ident_without_tumblr(ident)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
# See lib/sass/scss/parser.rb
|
37
|
+
class Parser
|
38
|
+
# Handle Tumblr variable tags in CSS selector
|
39
|
+
# Used from StaticParser and Parser.
|
40
|
+
alias :almost_any_value_token_without_tumblr :almost_any_value_token
|
41
|
+
def almost_any_value_token
|
42
|
+
tok(TUMBLR_VAR) || almost_any_value_token_without_tumblr
|
43
|
+
end
|
44
|
+
|
45
|
+
# Handle Tumblr variable tags in CSS key
|
46
|
+
# Used from StaticParser and Parser.
|
47
|
+
alias :interp_ident_without_tumblr :interp_ident
|
48
|
+
def interp_ident(ident = IDENT)
|
49
|
+
if var = tok(TUMBLR_VAR)
|
50
|
+
[var]
|
51
|
+
else
|
52
|
+
interp_ident_without_tumblr(ident)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
# Avoid to parse first "{" as a block in declaration for Tumblr variable tags in CSS value
|
57
|
+
# Used from all parsers.
|
58
|
+
alias :value_without_tumblr! :value!
|
59
|
+
def value!
|
60
|
+
if var = tok?(TUMBLR_VAR)
|
61
|
+
sass_script(:parse)
|
62
|
+
else
|
63
|
+
value_without_tumblr!
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
# See lib/sass/script/lexer.rb
|
70
|
+
module Script
|
71
|
+
class Lexer
|
72
|
+
# Handle Tumblr variable tags in CSS value
|
73
|
+
# Parse as ident token (like `middle', `top') in the parser.
|
74
|
+
# Used from all parsers.
|
75
|
+
alias :ident_without_tumblr_var :ident
|
76
|
+
def ident
|
77
|
+
if scan(TUMBLR_VAR)
|
78
|
+
[:ident, @scanner[1]]
|
79
|
+
else
|
80
|
+
ident_without_tumblr_var
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
metadata
ADDED
@@ -0,0 +1,102 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sass-tumblr
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Yoshimasa Niwa
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-02-17 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: sass
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 3.4.10
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 3.4.10
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.3'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.3'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: test-unit
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: Provide SSH port forwarding while deploying
|
70
|
+
email:
|
71
|
+
- niw@niw.at
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files:
|
75
|
+
- README.md
|
76
|
+
files:
|
77
|
+
- README.md
|
78
|
+
- lib/sass_tumblr.rb
|
79
|
+
homepage: https://github.com/niw/sass-tumblr
|
80
|
+
licenses: []
|
81
|
+
metadata: {}
|
82
|
+
post_install_message:
|
83
|
+
rdoc_options: []
|
84
|
+
require_paths:
|
85
|
+
- lib
|
86
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
96
|
+
requirements: []
|
97
|
+
rubyforge_project:
|
98
|
+
rubygems_version: 2.4.5
|
99
|
+
signing_key:
|
100
|
+
specification_version: 4
|
101
|
+
summary: Provide SSH port forwarding while deploying
|
102
|
+
test_files: []
|