glimmer-dsl-css 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +25 -9
- data/VERSION +1 -1
- data/glimmer-dsl-css.gemspec +73 -0
- data/lib/glimmer/css/rule.rb +5 -2
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f32c9be69c9bd6c6b0c3488039b7c33622116a678c83fc4237e09e9ad47ecb58
|
4
|
+
data.tar.gz: 4d0f2cd20601ff2c5af543aba2139c21027d82c3a30aabfafc6ff2ac1eaa82c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cccc83e762491fcd174270ddad8a3e58a492fa0d4d17f27df8080a2b5e4dfbaa0267eb2da2c328376baa2c37440cf295e347b80d619326d761d7f4d37cbd0ddb
|
7
|
+
data.tar.gz: 0a4f8a395bfea69e057c35ebebff3402d601536772ba406fbebccffecaf1b07d5af7ac748695f968df0db037ee926d3952654fbb9880660af9952e5523f25e43
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for CSS 1.
|
1
|
+
# [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for CSS 1.1.0
|
2
2
|
[![Gem Version](https://badge.fury.io/rb/glimmer-dsl-css.svg)](http://badge.fury.io/rb/glimmer-dsl-css)
|
3
3
|
[![Travis CI](https://travis-ci.com/AndyObtiva/glimmer-dsl-css.svg?branch=master)](https://travis-ci.com/github/AndyObtiva/glimmer-dsl-css)
|
4
4
|
[![Coverage Status](https://coveralls.io/repos/github/AndyObtiva/glimmer-dsl-css/badge.svg?branch=master)](https://coveralls.io/github/AndyObtiva/glimmer-dsl-css?branch=master)
|
@@ -9,8 +9,11 @@
|
|
9
9
|
|
10
10
|
Within the context of [Glimmer](https://github.com/AndyObtiva/glimmer) app development, Glimmer DSL for CSS is useful in providing CSS for the [SWT Browser widget](https://github.com/AndyObtiva/glimmer-dsl-swt/tree/master#browser-widget).
|
11
11
|
|
12
|
+
Additionally, it is useful with [Glimmer DSL for Opal](https://github.com/AndyObtiva/glimmer-dsl-opal)
|
13
|
+
|
12
14
|
Other [Glimmer](https://github.com/AndyObtiva/glimmer) DSL gems:
|
13
|
-
- [glimmer-dsl-swt](https://github.com/AndyObtiva/glimmer-dsl-swt): Glimmer DSL for SWT (Desktop GUI)
|
15
|
+
- [glimmer-dsl-swt](https://github.com/AndyObtiva/glimmer-dsl-swt): Glimmer DSL for SWT (JRuby Desktop Development GUI Library)
|
16
|
+
- [glimmer-dsl-tk](https://github.com/AndyObtiva/glimmer-dsl-tk): Glimmer DSL for Tk (Ruby Desktop Development GUI Library)
|
14
17
|
- [glimmer-dsl-opal](https://github.com/AndyObtiva/glimmer-dsl-opal): Glimmer DSL for Opal (Web GUI Adapter for Desktop Apps)
|
15
18
|
- [glimmer-dsl-xml](https://github.com/AndyObtiva/glimmer-dsl-xml): Glimmer DSL for XML (& HTML)
|
16
19
|
|
@@ -22,7 +25,7 @@ Please follow these instructions to make the `glimmer` command available on your
|
|
22
25
|
|
23
26
|
Run this command to install directly:
|
24
27
|
```
|
25
|
-
gem install glimmer-dsl-css -v 1.
|
28
|
+
gem install glimmer-dsl-css -v 1.1.0
|
26
29
|
```
|
27
30
|
|
28
31
|
Note: In case you are using JRuby, `jgem` is JRuby's version of the `gem` command. RVM allows running `gem` as an alias in JRuby. Otherwise, you may also run `jruby -S gem install ...`
|
@@ -37,14 +40,16 @@ That's it! Requiring the gem activates the Glimmer CSS DSL automatically.
|
|
37
40
|
|
38
41
|
Add the following to `Gemfile` (after `glimmer-dsl-swt` and/or `glimmer-dsl-opal` if included too):
|
39
42
|
```
|
40
|
-
gem 'glimmer-dsl-css', '~> 1.
|
43
|
+
gem 'glimmer-dsl-css', '~> 1.1.0'
|
41
44
|
```
|
42
45
|
|
43
46
|
And, then run:
|
44
47
|
```
|
45
|
-
|
48
|
+
bundle install
|
46
49
|
```
|
47
50
|
|
51
|
+
Note: When using JRuby, prefix with `jruby -S`
|
52
|
+
|
48
53
|
Require in your code via Bundler (e.g. `require 'bundler'; Bundler.require`) or add `require 'glimmer-dsl-css'` to your code.
|
49
54
|
|
50
55
|
When using with Glimmer DSL for SWT or Glimmer DSL for Opal, make sure it is loaded after `glimmer-dsl-swt` and `glimmer-dsl-opal` to give it a lower precedence than them when processed by the Glimmer DSL engine.
|
@@ -61,23 +66,34 @@ Once done, you may call `to_s` or `to_css` to get the formatted CSS output.
|
|
61
66
|
Selectors may be specified by `s` keyword or HTML element keyword directly (e.g. `body`)
|
62
67
|
Rule property values may be specified by `pv` keyword or underscored property name directly (e.g. `font_size`)
|
63
68
|
|
64
|
-
Example:
|
69
|
+
Example (you can try in IRB):
|
65
70
|
|
66
71
|
```ruby
|
72
|
+
require 'glimmer-dsl-css'
|
73
|
+
include Glimmer
|
67
74
|
@css = css {
|
68
75
|
body {
|
69
76
|
font_size '1.1em'
|
70
77
|
pv 'background', 'white'
|
71
|
-
}
|
72
|
-
|
78
|
+
}
|
73
79
|
s('body > h1') {
|
74
80
|
background_color :red
|
75
|
-
pv 'font-size',
|
81
|
+
pv 'font-size', 24
|
76
82
|
}
|
77
83
|
}
|
78
84
|
puts @css
|
79
85
|
```
|
80
86
|
|
87
|
+
Output (minified CSS):
|
88
|
+
|
89
|
+
```css
|
90
|
+
body{font-size:1.1em;background:white}body > h1{background-color:red;font-size:24px}
|
91
|
+
```
|
92
|
+
|
93
|
+
### Numeric Values
|
94
|
+
|
95
|
+
As you saw above, numeric values (e.g. `24` in `pv 'font-size', 24`) automatically get suffixed with `px` by convention (e.g. `24px`).
|
96
|
+
|
81
97
|
## Multi-DSL Support
|
82
98
|
|
83
99
|
Learn more about how to use this DSL alongside other Glimmer DSLs:
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.1.0
|
@@ -0,0 +1,73 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
# stub: glimmer-dsl-css 1.1.0 ruby lib
|
6
|
+
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
s.name = "glimmer-dsl-css".freeze
|
9
|
+
s.version = "1.1.0"
|
10
|
+
|
11
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib".freeze]
|
13
|
+
s.authors = ["AndyMaleh".freeze]
|
14
|
+
s.date = "2020-10-04"
|
15
|
+
s.description = "Glimmer DSL for CSS (Cascading Style Sheets)".freeze
|
16
|
+
s.email = "andy.am@gmail.com".freeze
|
17
|
+
s.extra_rdoc_files = [
|
18
|
+
"CHANGELOG.md",
|
19
|
+
"LICENSE.txt",
|
20
|
+
"README.md"
|
21
|
+
]
|
22
|
+
s.files = [
|
23
|
+
"CHANGELOG.md",
|
24
|
+
"CONTRIBUTING.md",
|
25
|
+
"LICENSE.txt",
|
26
|
+
"README.md",
|
27
|
+
"VERSION",
|
28
|
+
"glimmer-dsl-css.gemspec",
|
29
|
+
"lib/glimmer-dsl-css.rb",
|
30
|
+
"lib/glimmer/css/rule.rb",
|
31
|
+
"lib/glimmer/css/style_sheet.rb",
|
32
|
+
"lib/glimmer/dsl/css/css_expression.rb",
|
33
|
+
"lib/glimmer/dsl/css/dsl.rb",
|
34
|
+
"lib/glimmer/dsl/css/dynamic_property_expression.rb",
|
35
|
+
"lib/glimmer/dsl/css/property_expression.rb",
|
36
|
+
"lib/glimmer/dsl/css/pv_expression.rb",
|
37
|
+
"lib/glimmer/dsl/css/rule_expression.rb",
|
38
|
+
"lib/glimmer/dsl/css/s_expression.rb"
|
39
|
+
]
|
40
|
+
s.homepage = "http://github.com/AndyObtiva/glimmer-dsl-css".freeze
|
41
|
+
s.licenses = ["MIT".freeze]
|
42
|
+
s.rubygems_version = "3.1.4".freeze
|
43
|
+
s.summary = "Glimmer DSL for CSS".freeze
|
44
|
+
|
45
|
+
if s.respond_to? :specification_version then
|
46
|
+
s.specification_version = 4
|
47
|
+
end
|
48
|
+
|
49
|
+
if s.respond_to? :add_runtime_dependency then
|
50
|
+
s.add_runtime_dependency(%q<glimmer>.freeze, [">= 1.0.1", "< 2.0.0"])
|
51
|
+
s.add_development_dependency(%q<rspec-mocks>.freeze, ["~> 3.5.0"])
|
52
|
+
s.add_development_dependency(%q<rspec>.freeze, ["~> 3.5.0"])
|
53
|
+
s.add_development_dependency(%q<puts_debuggerer>.freeze, [">= 0"])
|
54
|
+
s.add_development_dependency(%q<rake>.freeze, [">= 10.1.0", "< 14.0.0"])
|
55
|
+
s.add_development_dependency(%q<jeweler>.freeze, [">= 2.3.9", "< 3.0.0"])
|
56
|
+
s.add_development_dependency(%q<rdoc>.freeze, [">= 6.2.1", "< 7.0.0"])
|
57
|
+
s.add_development_dependency(%q<coveralls>.freeze, ["= 0.8.23"])
|
58
|
+
s.add_development_dependency(%q<simplecov>.freeze, ["~> 0.16.1"])
|
59
|
+
s.add_development_dependency(%q<simplecov-lcov>.freeze, ["~> 0.7.0"])
|
60
|
+
else
|
61
|
+
s.add_dependency(%q<glimmer>.freeze, [">= 1.0.1", "< 2.0.0"])
|
62
|
+
s.add_dependency(%q<rspec-mocks>.freeze, ["~> 3.5.0"])
|
63
|
+
s.add_dependency(%q<rspec>.freeze, ["~> 3.5.0"])
|
64
|
+
s.add_dependency(%q<puts_debuggerer>.freeze, [">= 0"])
|
65
|
+
s.add_dependency(%q<rake>.freeze, [">= 10.1.0", "< 14.0.0"])
|
66
|
+
s.add_dependency(%q<jeweler>.freeze, [">= 2.3.9", "< 3.0.0"])
|
67
|
+
s.add_dependency(%q<rdoc>.freeze, [">= 6.2.1", "< 7.0.0"])
|
68
|
+
s.add_dependency(%q<coveralls>.freeze, ["= 0.8.23"])
|
69
|
+
s.add_dependency(%q<simplecov>.freeze, ["~> 0.16.1"])
|
70
|
+
s.add_dependency(%q<simplecov-lcov>.freeze, ["~> 0.7.0"])
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
data/lib/glimmer/css/rule.rb
CHANGED
@@ -36,8 +36,11 @@ module Glimmer
|
|
36
36
|
|
37
37
|
def to_css
|
38
38
|
css = "#{@selector}{"
|
39
|
-
css
|
40
|
-
|
39
|
+
css += @properties.map do |name, value|
|
40
|
+
value = "#{value}px" if value.is_a?(Numeric)
|
41
|
+
"#{name}:#{value}"
|
42
|
+
end.join(';')
|
43
|
+
css += "}"
|
41
44
|
end
|
42
45
|
|
43
46
|
alias to_s to_css
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glimmer-dsl-css
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AndyMaleh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: glimmer
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.0.
|
19
|
+
version: 1.0.1
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: 2.0.0
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 1.0.
|
29
|
+
version: 1.0.1
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 2.0.0
|
@@ -188,6 +188,7 @@ files:
|
|
188
188
|
- LICENSE.txt
|
189
189
|
- README.md
|
190
190
|
- VERSION
|
191
|
+
- glimmer-dsl-css.gemspec
|
191
192
|
- lib/glimmer-dsl-css.rb
|
192
193
|
- lib/glimmer/css/rule.rb
|
193
194
|
- lib/glimmer/css/style_sheet.rb
|
@@ -217,7 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
217
218
|
- !ruby/object:Gem::Version
|
218
219
|
version: '0'
|
219
220
|
requirements: []
|
220
|
-
rubygems_version: 3.1.
|
221
|
+
rubygems_version: 3.1.4
|
221
222
|
signing_key:
|
222
223
|
specification_version: 4
|
223
224
|
summary: Glimmer DSL for CSS
|