hexp 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MDg4OWIzYzg3MzRjNTE2Mjk5YTk3NzBiNzYzNmFhMjA4ZWNjNWM3MQ==
5
+ data.tar.gz: !binary |-
6
+ NmUyYzliZTM4NDc0MzFhMjJiNTIzYmU4YWNhODE2ZWM0OTkwYTE5Zg==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ OTA3ODA1Nzc1MGMzYzIwMDViZjA3NTk2MDcyYzA2ZDNiZTBjMWZlMTZmNjJj
10
+ NzAyYTMzZjQwOWIzNjRmZWVhNTY0MWU3N2QzMTJhMDliZjdmMGQxNDVhZGVi
11
+ YjJlZWRhZTcwNDRiYjllOGI0N2JhMjFkMTZmMmQyYjdjOGFkMGQ=
12
+ data.tar.gz: !binary |-
13
+ OGVjMGNmNmFmZTFjNzkxNzE3N2ZkY2EwNTNmYzBkOTdmMjcxMWVlNmMwOTg0
14
+ NzYwMmEyYjBiOWQ3ODY3MzM4Y2MyNDIwZDY1ODMyZjk0NjhkZjEyN2EzOTBl
15
+ NWM5YWFkMDBkYTBkNTMxNmQ2ODc0MTA0YTNhYzBlZTExMmY0Mjg=
data/.gitignore CHANGED
@@ -11,6 +11,7 @@ spec/reports
11
11
  test/tmp
12
12
  test/version_tmp
13
13
  tmp
14
+ vendor
14
15
 
15
16
  # YARD artifacts
16
17
  .yardoc
@@ -19,3 +20,6 @@ doc/
19
20
 
20
21
  #yardstick report
21
22
  measurements/report.txt
23
+
24
+ # Automatic Ruby switching
25
+ .ruby-version
data/.travis.yml CHANGED
@@ -6,8 +6,8 @@ rvm:
6
6
  - 1.9.2
7
7
  - 1.9.3
8
8
  - 2.0.0
9
+ - 2.1.0
9
10
  - ruby-head
10
- - rbx-19mode
11
11
  matrix:
12
12
  include:
13
13
  - rvm: jruby-19mode
@@ -15,10 +15,9 @@ matrix:
15
15
  - rvm: jruby-head
16
16
  env: JRUBY_OPTS="$JRUBY_OPTS --debug"
17
17
  allow_failures:
18
+ - rvm: jruby-19mode
18
19
  - rvm: ruby-head
19
- - rvm: rbx-19mode
20
20
  - rvm: jruby-head
21
- - rvm: jruby-19mode
22
21
  notifications:
23
22
  email:
24
23
  recipients:
data/.yardopts ADDED
@@ -0,0 +1 @@
1
+ --no-private -q - LICENSE
data/Gemfile.devtools CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  group :development do
4
4
  gem 'rake', '~> 10.1.0'
5
- gem 'rspec', '~> 2.14.0'
6
- gem 'yard', '~> 0.8.6.2'
5
+ gem 'rspec', '~> 2.14.1'
6
+ gem 'yard', '~> 0.8.7'
7
7
  end
8
8
 
9
9
  group :yard do
@@ -15,40 +15,33 @@ group :guard do
15
15
  gem 'guard-bundler', '~> 1.0.0'
16
16
  gem 'guard-rspec', '~> 3.0.2'
17
17
  gem 'guard-rubocop', '~> 0.2.0'
18
+ # gem 'guard-mutant', '~> 0.0.1'
18
19
 
19
20
  # file system change event handling
20
- gem 'listen', '~> 1.2.2'
21
- gem 'rb-fchange', '~> 0.0.6', :require => false
22
- gem 'rb-fsevent', '~> 0.9.3', :require => false
23
- gem 'rb-inotify', '~> 0.9.0', :require => false
21
+ gem 'listen', '~> 1.3.0'
22
+ gem 'rb-fchange', '~> 0.0.6', require: false
23
+ gem 'rb-fsevent', '~> 0.9.3', require: false
24
+ gem 'rb-inotify', '~> 0.9.0', require: false
24
25
 
25
26
  # notification handling
26
- gem 'libnotify', '~> 0.8.0', :require => false
27
- gem 'rb-notifu', '~> 0.0.4', :require => false
28
- gem 'terminal-notifier-guard', '~> 1.5.3', :require => false
27
+ gem 'libnotify', '~> 0.8.0', require: false
28
+ gem 'rb-notifu', '~> 0.0.4', require: false
29
+ gem 'terminal-notifier-guard', '~> 1.5.3', require: false
29
30
  end
30
31
 
31
32
  group :metrics do
32
33
  gem 'coveralls', '~> 0.6.7'
33
- gem 'flay', '~> 2.3.0'
34
- gem 'flog', '~> 4.1.0'
35
- gem 'reek', github: 'troessner/reek'
36
- gem 'rubocop', '~> 0.9.1'
37
- gem 'simplecov', github: 'colszowka/simplecov'
38
- gem 'yardstick', '~> 0.9.6'
34
+ gem 'flay', '~> 2.4.0'
35
+ gem 'flog', '~> 4.1.1'
36
+ gem 'reek', '~> 1.3.2'
37
+ gem 'rubocop', '~> 0.11.0'
38
+ gem 'simplecov', '~> 0.7.1'
39
+ gem 'yardstick', '~> 0.9.7', git: 'https://github.com/dkubb/yardstick.git'
39
40
 
40
41
  platforms :ruby_19, :ruby_20 do
41
- #gem 'mutant', '~> 0.3.0.beta13'
42
+ # gem 'mutant', git: 'https://github.com/mbj/mutant.git'
42
43
  gem 'yard-spellcheck', '~> 0.1.5'
43
44
  end
44
-
45
- platforms :ruby_19 do
46
- gem 'json', '~> 1.8.0'
47
- end
48
-
49
- platforms :rbx do
50
- gem 'pelusa', '~> 0.2.2'
51
- end
52
45
  end
53
46
 
54
47
  group :benchmarks do
data/Gemfile.lock CHANGED
@@ -1,190 +1,185 @@
1
- GIT
2
- remote: git://github.com/colszowka/simplecov.git
3
- revision: a3387f7b25100939df6a5af339580cbe3055cdc6
4
- specs:
5
- simplecov (0.8.0.pre)
6
- multi_json
7
- simplecov-html (~> 0.7.1)
8
-
9
1
  GIT
10
2
  remote: git://github.com/rom-rb/devtools.git
11
- revision: 49e6b05b9915c990a2e45dc24f7318b4d7a95e88
3
+ revision: 6c73036e93244e6392504bfe226139181589e20d
12
4
  specs:
13
5
  devtools (0.0.2)
14
6
 
15
7
  GIT
16
- remote: git://github.com/troessner/reek.git
17
- revision: c901c37f8a1de8e8a89221710ae37ea89a768db0
8
+ remote: https://github.com/dkubb/yardstick.git
9
+ revision: 3d0b28f2044cb9e33353c962d3d8f833ed764045
18
10
  specs:
19
- reek (1.3.2)
20
- ruby2ruby (~> 2.0.2)
21
- ruby_parser (~> 3.1.1)
22
- sexp_processor
11
+ yardstick (0.9.9)
12
+ yard (~> 0.8, >= 0.8.7.2)
23
13
 
24
14
  PATH
25
15
  remote: .
26
16
  specs:
27
- hexp (0.2.0)
17
+ hexp (0.3.0)
28
18
  equalizer (~> 0.0)
29
- ice_nine (~> 0.8)
19
+ ice_nine (~> 0.9)
30
20
  nokogiri (~> 1.6)
31
21
  sass (~> 3.2)
32
22
 
33
23
  GEM
34
24
  remote: https://rubygems.org/
35
25
  specs:
36
- adamantium (0.0.11)
37
- ice_nine (~> 0.8.0)
38
26
  ast (1.1.0)
39
- backports (3.3.3)
27
+ backports (3.3.5)
28
+ benchmark-ips (1.2.0)
29
+ benchmark_suite (1.0.0)
30
+ benchmark-ips (~> 1.0)
40
31
  bouncy-castle-java (1.5.0147)
41
- coderay (1.0.9)
42
- colorize (0.5.8)
43
- coveralls (0.6.7)
44
- colorize
32
+ coderay (1.1.0)
33
+ coveralls (0.6.9)
45
34
  multi_json (~> 1.3)
46
35
  rest-client
47
36
  simplecov (>= 0.7)
37
+ term-ansicolor
48
38
  thor
49
- diff-lcs (1.2.4)
50
- equalizer (0.0.5)
51
- adamantium (~> 0.0.6)
52
- backports (~> 3.0, >= 3.0.3)
53
- ffi (1.9.0)
54
- ffi (1.9.0-java)
39
+ diff-lcs (1.2.5)
40
+ equalizer (0.0.9)
41
+ ffi (1.9.3)
42
+ ffi (1.9.3-java)
55
43
  ffi-hunspell (0.3.0)
56
44
  ffi (~> 1.0)
57
- flay (2.3.1)
45
+ flay (2.4.0)
58
46
  ruby_parser (~> 3.0)
59
47
  sexp_processor (~> 4.0)
60
- flog (4.1.1)
48
+ flog (4.1.2)
61
49
  ruby_parser (~> 3.1, > 3.1.0)
62
50
  sexp_processor (~> 4.0)
63
51
  formatador (0.2.4)
64
- guard (1.8.2)
52
+ guard (1.8.3)
65
53
  formatador (>= 0.2.4)
66
- listen (>= 1.0.0)
54
+ listen (~> 1.3)
67
55
  lumberjack (>= 1.0.2)
68
56
  pry (>= 0.9.10)
69
57
  thor (>= 0.14.6)
70
58
  guard-bundler (1.0.0)
71
59
  bundler (~> 1.0)
72
60
  guard (~> 1.1)
73
- guard-rspec (3.0.2)
61
+ guard-rspec (3.0.3)
74
62
  guard (>= 1.8)
75
63
  rspec (~> 2.13)
76
- guard-rubocop (0.2.1)
64
+ guard-rubocop (0.2.2)
77
65
  guard (~> 1.8)
78
- rubocop (~> 0.9)
79
- ice_nine (0.8.0)
80
- jruby-openssl (0.8.8)
66
+ rubocop (~> 0.10)
67
+ ice_nine (0.11.0)
68
+ jruby-openssl (0.8.10)
81
69
  bouncy-castle-java (>= 1.5.0147)
82
- json (1.8.0)
83
70
  kramdown (1.1.0)
84
- libnotify (0.8.1)
71
+ libnotify (0.8.2)
85
72
  ffi (>= 1.0.11)
86
- listen (1.2.3)
73
+ listen (1.3.1)
87
74
  rb-fsevent (>= 0.9.3)
88
75
  rb-inotify (>= 0.9)
89
76
  rb-kqueue (>= 0.2)
90
77
  lumberjack (1.0.4)
91
78
  method_source (0.8.2)
92
- mime-types (1.24)
93
- mini_portile (0.5.1)
94
- multi_json (1.7.9)
95
- nokogiri (1.6.0)
79
+ mime-types (2.1)
80
+ mini_portile (0.5.2)
81
+ multi_json (1.8.4)
82
+ nokogiri (1.6.1)
96
83
  mini_portile (~> 0.5.0)
97
- nokogiri (1.6.0-java)
84
+ nokogiri (1.6.1-java)
98
85
  mini_portile (~> 0.5.0)
99
- parser (2.0.0.pre1)
86
+ parser (2.0.0)
100
87
  ast (~> 1.1)
101
88
  slop (~> 3.4, >= 3.4.5)
102
- pelusa (0.2.2)
103
- pry (0.9.12.2)
104
- coderay (~> 1.0.5)
89
+ powerpack (0.0.9)
90
+ pry (0.9.12.5)
91
+ coderay (~> 1.0)
105
92
  method_source (~> 0.8)
106
93
  slop (~> 3.4)
107
- pry (0.9.12.2-java)
108
- coderay (~> 1.0.5)
94
+ pry (0.9.12.5-java)
95
+ coderay (~> 1.0)
109
96
  method_source (~> 0.8)
110
97
  slop (~> 3.4)
111
98
  spoon (~> 0.0)
112
- rainbow (1.1.4)
113
- rake (10.1.0)
99
+ rainbow (2.0.0)
100
+ rake (10.1.1)
114
101
  rb-fchange (0.0.6)
115
102
  ffi
116
- rb-fsevent (0.9.3)
117
- rb-inotify (0.9.1)
103
+ rb-fsevent (0.9.4)
104
+ rb-inotify (0.9.3)
118
105
  ffi (>= 0.5.0)
119
106
  rb-kqueue (0.2.0)
120
107
  ffi (>= 0.5.0)
121
108
  rb-notifu (0.0.4)
122
109
  rbench (0.2.3)
110
+ reek (1.3.6)
111
+ ruby2ruby (~> 2.0.7)
112
+ ruby_parser (~> 3.2)
113
+ sexp_processor
123
114
  rest-client (1.6.7)
124
115
  mime-types (>= 1.16)
125
116
  rspec (2.14.1)
126
117
  rspec-core (~> 2.14.0)
127
118
  rspec-expectations (~> 2.14.0)
128
119
  rspec-mocks (~> 2.14.0)
129
- rspec-core (2.14.5)
130
- rspec-expectations (2.14.2)
120
+ rspec-core (2.14.7)
121
+ rspec-expectations (2.14.4)
131
122
  diff-lcs (>= 1.1.3, < 2.0)
132
- rspec-mocks (2.14.3)
133
- rubocop (0.9.1)
134
- parser (= 2.0.0.pre1)
123
+ rspec-mocks (2.14.4)
124
+ rubocop (0.11.1)
125
+ backports (~> 3.3.3)
126
+ parser (~> 2.0.0.pre6)
127
+ powerpack (~> 0.0.3)
135
128
  rainbow (>= 1.1.4)
136
- ruby2ruby (2.0.6)
129
+ ruby2ruby (2.0.7)
137
130
  ruby_parser (~> 3.1)
138
131
  sexp_processor (~> 4.0)
139
- ruby_parser (3.1.3)
132
+ ruby_parser (3.3.0)
140
133
  sexp_processor (~> 4.1)
141
- sass (3.2.10)
142
- sexp_processor (4.2.1)
134
+ sass (3.2.14)
135
+ sexp_processor (4.4.1)
136
+ simplecov (0.7.1)
137
+ multi_json (~> 1.0)
138
+ simplecov-html (~> 0.7.1)
143
139
  simplecov-html (0.7.1)
144
- slop (3.4.6)
140
+ slop (3.4.7)
145
141
  spoon (0.0.4)
146
142
  ffi
143
+ term-ansicolor (1.2.2)
144
+ tins (~> 0.8)
147
145
  terminal-notifier-guard (1.5.3)
148
146
  thor (0.18.1)
149
- yard (0.8.6.2)
147
+ tins (0.13.1)
148
+ yard (0.8.7.3)
150
149
  yard-spellcheck (0.1.5)
151
150
  ffi-hunspell (~> 0.2)
152
151
  yard (~> 0.6)
153
- yardstick (0.9.6)
154
- backports (~> 3.3, >= 3.3.0)
155
- yard (~> 0.8, >= 0.8.6)
156
152
 
157
153
  PLATFORMS
158
154
  java
159
155
  ruby
160
156
 
161
157
  DEPENDENCIES
158
+ benchmark_suite (~> 1.0)
162
159
  coveralls (~> 0.6.7)
163
160
  devtools!
164
- flay (~> 2.3.0)
165
- flog (~> 4.1.0)
161
+ flay (~> 2.4.0)
162
+ flog (~> 4.1.1)
166
163
  guard (~> 1.8.1)
167
164
  guard-bundler (~> 1.0.0)
168
165
  guard-rspec (~> 3.0.2)
169
166
  guard-rubocop (~> 0.2.0)
170
167
  hexp!
171
168
  jruby-openssl (~> 0.8.5)
172
- json (~> 1.8.0)
173
169
  kramdown (~> 1.1.0)
174
170
  libnotify (~> 0.8.0)
175
- listen (~> 1.2.2)
176
- pelusa (~> 0.2.2)
171
+ listen (~> 1.3.0)
177
172
  rake (~> 10.1.0)
178
173
  rb-fchange (~> 0.0.6)
179
174
  rb-fsevent (~> 0.9.3)
180
175
  rb-inotify (~> 0.9.0)
181
176
  rb-notifu (~> 0.0.4)
182
177
  rbench (~> 0.2.3)
183
- reek!
184
- rspec (~> 2.14.0)
185
- rubocop (~> 0.9.1)
186
- simplecov!
178
+ reek (~> 1.3.2)
179
+ rspec (~> 2.14.1)
180
+ rubocop (~> 0.11.0)
181
+ simplecov (~> 0.7.1)
187
182
  terminal-notifier-guard (~> 1.5.3)
188
- yard (~> 0.8.6.2)
183
+ yard (~> 0.8.7)
189
184
  yard-spellcheck (~> 0.1.5)
190
- yardstick (~> 0.9.6)
185
+ yardstick (~> 0.9.7)!
File without changes
data/README.md CHANGED
@@ -10,10 +10,19 @@
10
10
  [codeclimate]: https://codeclimate.com/github/plexus/hexp
11
11
  [coveralls]: https://coveralls.io/r/plexus/hexp
12
12
 
13
- A bit about hexps
14
- -----------------
13
+ # Hexp
15
14
 
16
- **What on earth is a Hexp?**
15
+ **Hexp** (pronounced [ˈɦækspi:]) is a Ruby API for creating and manipulating HTML syntax trees. It enables a web application architecture where HTML is only ever represented as structured data, rather than as plain text.
16
+
17
+ Only when the data needs to be serialized and sent over the network is it converted to a string representation. This has a number of advantages.
18
+
19
+ * Single responsibility : HTML generation is not mixed with business logic
20
+ * Security : Protection from XSS (cross-site scripting)
21
+ * Productivity : components that create or alter fragments of a HTML become generic, reusable parts
22
+
23
+ For a more in-depth explanation please see the slides of talk [Web Linguistics, Towards Higher Fluency](http://arnebrasseur.net/talks/eurucamp2013/presentation.html) given at Eurucamp 2013. (the video is not available yet.)
24
+
25
+ **Creating Hexps**
17
26
 
18
27
  Hexps are basically snippets of HTML written in nothing but Ruby, here's an example.
19
28
 
@@ -25,6 +34,8 @@ Hexps are basically snippets of HTML written in nothing but Ruby, here's an exam
25
34
  ]
26
35
  ````
27
36
 
37
+ For more info to get you up and running have a look at the API documentation for [Hexp::Node](http://plexus.github.io/hexp/Hexp/Node.html).
38
+
28
39
  **Don't people use templates for this kind of thing?**
29
40
 
30
41
  They do, this is an alternative approach. With templates you need to think about which parts need to be HTML-escaped, or you can make errors like forgetting a closing tag. With hexps you no longer need to think about escaping.
@@ -84,14 +95,18 @@ The entire API is centered around these two classes, and one of them you can thi
84
95
  A note on immutability
85
96
  ----------------------
86
97
 
87
- All Hexp objects are deep frozen on creation, you can never alter them afterwards. Operations always return a new `Hexp::Node` rather than working in place.
98
+ All Hexp objects are frozen on creation, you can never alter them afterwards. Operations always return a new `Hexp::Node` rather than working in place.
88
99
 
89
100
  This might seem stringent when you are not used to this style of coding, but it's a pattern that generally promotes good code.
90
101
 
91
102
  Can I already use it
92
103
  --------------------
93
104
 
94
- Hold your horses, this is *very* alpha level code! Feedback is very much appreciated, so try it out, and let me know what you think. Basic functionality is there, but it's far from finished, and the API will probably still change based on feedback. You have been warned.
105
+ Yes, but there are some things to keep in mind.
106
+
107
+ For the 0.x line of versions Hexp is not restricted to [semantic versioning](http://semver.org). We are still designing the API, and small backwards incompatible changes may occur. However given that the project's aim is to only provide the lowest level of DOM manipulation upon which others can built, it is already quite feature complete. It shouldn't be too long before we release a 1.0.0, after which we will commit to semantic versioning.
108
+
109
+ Another thing is that Hexp is young. It hasn't been battle tested yet, and the ecosystem which will make this approach truly attractive is yet to emerge. Therefore better try it out on smaller, non-critical projects first, and give us your feedback.
95
110
 
96
111
  Is it any good?
97
112
  ---------------
@@ -108,8 +123,3 @@ At this point you're best off grabbing the Git repo, e.g. with bundler
108
123
 
109
124
  gem 'hexp', github: 'plexus/hexp'
110
125
  ````
111
-
112
- Who is behind this
113
- ------------------
114
-
115
- Hexp is conceived and created by [Arne Brasseur](http://arnebrasseur.net)