slippery 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,71 +0,0 @@
1
- # Logfile created on 2014-02-23 15:27:32 +0100 by logger.rb/31641
2
- I, [2014-02-23T15:27:32.144969 #18519] INFO -- : 0: rake (10.1.0) from /home/arne/.gem/ruby/1.9.3/specifications/rake-10.1.0.gemspec
3
- I, [2014-02-23T15:27:32.145555 #18519] INFO -- : 0: abstract_type (0.0.6) from /home/arne/.gem/ruby/1.9.3/specifications/abstract_type-0.0.6.gemspec
4
- I, [2014-02-23T15:27:32.146017 #18519] INFO -- : 0: ice_nine (0.9.0) from /home/arne/.gem/ruby/1.9.3/specifications/ice_nine-0.9.0.gemspec
5
- I, [2014-02-23T15:27:33.847175 #18519] INFO -- : 0: adamantium (0.0.11) from /home/arne/.gem/ruby/1.9.3/specifications/adamantium-0.0.11.gemspec
6
- I, [2014-02-23T15:27:33.847675 #18519] INFO -- : 0: backports (3.3.3) from /home/arne/.gem/ruby/1.9.3/specifications/backports-3.3.3.gemspec
7
- I, [2014-02-23T15:27:36.243686 #18519] INFO -- : 0: equalizer (0.0.5) from /home/arne/.gem/ruby/1.9.3/specifications/equalizer-0.0.5.gemspec
8
- I, [2014-02-23T15:27:37.834424 #18519] INFO -- : 0: anima (0.0.6) from /home/arne/.gem/ruby/1.9.3/specifications/anima-0.0.6.gemspec
9
- I, [2014-02-23T15:27:37.834899 #18519] INFO -- : 0: ast (1.1.0) from /home/arne/.gem/ruby/1.9.3/specifications/ast-1.1.0.gemspec
10
- I, [2014-02-23T15:27:37.835247 #18519] INFO -- : 0: bundler (1.5.1) from /home/arne/.gem/ruby/1.9.3/specifications/bundler-1.5.1.gemspec
11
- I, [2014-02-23T15:27:37.835602 #18519] INFO -- : 0: coderay (1.0.9) from /home/arne/.gem/ruby/1.9.3/specifications/coderay-1.0.9.gemspec
12
- I, [2014-02-23T15:27:37.835950 #18519] INFO -- : 0: colorize (0.5.8) from /home/arne/.gem/ruby/1.9.3/specifications/colorize-0.5.8.gemspec
13
- I, [2014-02-23T15:27:39.347016 #18519] INFO -- : 0: concord (0.1.2) from /home/arne/.gem/ruby/1.9.3/specifications/concord-0.1.2.gemspec
14
- I, [2014-02-23T15:27:40.752853 #18519] INFO -- : 0: multi_json (1.7.7) from /home/arne/.gem/ruby/1.9.3/specifications/multi_json-1.7.7.gemspec
15
- I, [2014-02-23T15:27:42.348292 #18519] INFO -- : 0: mime-types (1.23) from /home/arne/.gem/ruby/1.9.3/specifications/mime-types-1.23.gemspec
16
- I, [2014-02-23T15:27:42.348833 #18519] INFO -- : 0: rest-client (1.6.7) from /home/arne/.gem/ruby/1.9.3/specifications/rest-client-1.6.7.gemspec
17
- I, [2014-02-23T15:27:42.349221 #18519] INFO -- : 0: simplecov-html (0.7.1) from /home/arne/.gem/ruby/1.9.3/specifications/simplecov-html-0.7.1.gemspec
18
- I, [2014-02-23T15:27:42.349611 #18519] INFO -- : 0: simplecov (0.7.1) from /home/arne/.gem/ruby/1.9.3/specifications/simplecov-0.7.1.gemspec
19
- I, [2014-02-23T15:27:42.349983 #18519] INFO -- : 0: thor (0.18.1) from /home/arne/.gem/ruby/1.9.3/specifications/thor-0.18.1.gemspec
20
- I, [2014-02-23T15:27:42.350354 #18519] INFO -- : 0: coveralls (0.6.7) from /home/arne/.gem/ruby/1.9.3/specifications/coveralls-0.6.7.gemspec
21
- I, [2014-02-23T15:27:42.350723 #18519] INFO -- : 0: descendants_tracker (0.0.1) from /home/arne/.gem/ruby/1.9.3/specifications/descendants_tracker-0.0.1.gemspec
22
- I, [2014-02-23T15:27:42.376637 #18519] INFO -- : 0: devtools (0.0.2) from /home/arne/.gem/ruby/1.9.3/bundler/gems/devtools-bca222ee252d/devtools.gemspec
23
- I, [2014-02-23T15:27:42.377248 #18519] INFO -- : 0: diff-lcs (1.2.4) from /home/arne/.gem/ruby/1.9.3/specifications/diff-lcs-1.2.4.gemspec
24
- I, [2014-02-23T15:27:42.377663 #18519] INFO -- : 0: ffi (1.9.0) from /home/arne/.gem/ruby/1.9.3/specifications/ffi-1.9.0.gemspec
25
- I, [2014-02-23T15:27:42.378065 #18519] INFO -- : 0: ffi-hunspell (0.3.0) from /home/arne/.gem/ruby/1.9.3/specifications/ffi-hunspell-0.3.0.gemspec
26
- I, [2014-02-23T15:27:43.926273 #18519] INFO -- : 0: sexp_processor (4.2.1) from /home/arne/.gem/ruby/1.9.3/specifications/sexp_processor-4.2.1.gemspec
27
- I, [2014-02-23T15:27:43.926825 #18519] INFO -- : 0: ruby_parser (3.1.3) from /home/arne/.gem/ruby/1.9.3/specifications/ruby_parser-3.1.3.gemspec
28
- I, [2014-02-23T15:27:45.311529 #18519] INFO -- : 0: flay (2.3.1) from /home/arne/.gem/ruby/1.9.3/specifications/flay-2.3.1.gemspec
29
- I, [2014-02-23T15:27:45.312027 #18519] INFO -- : 0: flog (4.1.1) from /home/arne/.gem/ruby/1.9.3/specifications/flog-4.1.1.gemspec
30
- I, [2014-02-23T15:27:45.312377 #18519] INFO -- : 0: formatador (0.2.4) from /home/arne/.gem/ruby/1.9.3/specifications/formatador-0.2.4.gemspec
31
- I, [2014-02-23T15:27:45.312743 #18519] INFO -- : 0: fzip (0.2.0) from /home/arne/.gem/ruby/1.9.3/specifications/fzip-0.2.0.gemspec
32
- I, [2014-02-23T15:27:45.313092 #18519] INFO -- : 0: rb-fsevent (0.9.3) from /home/arne/.gem/ruby/1.9.3/specifications/rb-fsevent-0.9.3.gemspec
33
- I, [2014-02-23T15:27:45.313446 #18519] INFO -- : 0: rb-inotify (0.9.0) from /home/arne/.gem/ruby/1.9.3/specifications/rb-inotify-0.9.0.gemspec
34
- I, [2014-02-23T15:27:45.313786 #18519] INFO -- : 0: rb-kqueue (0.2.0) from /home/arne/.gem/ruby/1.9.3/specifications/rb-kqueue-0.2.0.gemspec
35
- I, [2014-02-23T15:27:46.784270 #18519] INFO -- : 0: listen (1.2.2) from /home/arne/.gem/ruby/1.9.3/specifications/listen-1.2.2.gemspec
36
- I, [2014-02-23T15:27:46.784900 #18519] INFO -- : 0: lumberjack (1.0.4) from /home/arne/.gem/ruby/1.9.3/specifications/lumberjack-1.0.4.gemspec
37
- I, [2014-02-23T15:27:48.173953 #18519] INFO -- : 0: method_source (0.8.1) from /home/arne/.gem/ruby/1.9.3/specifications/method_source-0.8.1.gemspec
38
- I, [2014-02-23T15:27:49.680455 #18519] INFO -- : 0: slop (3.4.5) from /home/arne/.gem/ruby/1.9.3/specifications/slop-3.4.5.gemspec
39
- I, [2014-02-23T15:27:49.681067 #18519] INFO -- : 0: pry (0.9.12.2) from /home/arne/.gem/ruby/1.9.3/specifications/pry-0.9.12.2.gemspec
40
- I, [2014-02-23T15:27:51.562761 #18519] INFO -- : 0: guard (1.8.1) from /home/arne/.gem/ruby/1.9.3/specifications/guard-1.8.1.gemspec
41
- I, [2014-02-23T15:27:51.563253 #18519] INFO -- : 0: guard-bundler (1.0.0) from /home/arne/.gem/ruby/1.9.3/specifications/guard-bundler-1.0.0.gemspec
42
- I, [2014-02-23T15:27:51.563595 #18519] INFO -- : 0: inflecto (0.0.2) from /home/arne/.gem/ruby/1.9.3/specifications/inflecto-0.0.2.gemspec
43
- I, [2014-02-23T15:27:55.012144 #18519] INFO -- : 0: parser (2.0.0.pre2) from /home/arne/.gem/ruby/1.9.3/specifications/parser-2.0.0.pre2.gemspec
44
- I, [2014-02-23T15:27:57.130110 #18519] INFO -- : 0: rspec-core (2.14.3) from /home/arne/.gem/ruby/1.9.3/specifications/rspec-core-2.14.3.gemspec
45
- I, [2014-02-23T15:27:58.927580 #18519] INFO -- : 0: rspec-expectations (2.14.0) from /home/arne/.gem/ruby/1.9.3/specifications/rspec-expectations-2.14.0.gemspec
46
- I, [2014-02-23T15:28:00.911900 #18519] INFO -- : 0: rspec-mocks (2.14.1) from /home/arne/.gem/ruby/1.9.3/specifications/rspec-mocks-2.14.1.gemspec
47
- I, [2014-02-23T15:28:00.912443 #18519] INFO -- : 0: rspec (2.14.1) from /home/arne/.gem/ruby/1.9.3/specifications/rspec-2.14.1.gemspec
48
- I, [2014-02-23T15:28:03.003962 #18519] INFO -- : 0: unparser (0.0.8) from /home/arne/.gem/ruby/1.9.3/specifications/unparser-0.0.8.gemspec
49
- I, [2014-02-23T15:28:05.401383 #18519] INFO -- : 0: mutant (0.3.0.beta18) from /home/arne/.gem/ruby/1.9.3/specifications/mutant-0.3.0.beta18.gemspec
50
- I, [2014-02-23T15:28:05.401965 #18519] INFO -- : 0: guard-mutant (0.0.1) from /home/arne/.gem/ruby/1.9.3/specifications/guard-mutant-0.0.1.gemspec
51
- I, [2014-02-23T15:28:05.402415 #18519] INFO -- : 0: guard-rspec (3.0.2) from /home/arne/.gem/ruby/1.9.3/specifications/guard-rspec-3.0.2.gemspec
52
- I, [2014-02-23T15:28:06.770115 #18519] INFO -- : 0: powerpack (0.0.1) from /home/arne/.gem/ruby/1.9.3/specifications/powerpack-0.0.1.gemspec
53
- I, [2014-02-23T15:28:06.770720 #18519] INFO -- : 0: rainbow (1.1.4) from /home/arne/.gem/ruby/1.9.3/specifications/rainbow-1.1.4.gemspec
54
- I, [2014-02-23T15:28:06.962855 #18519] INFO -- : 0: rubocop (0.10.0) from /home/arne/.gem/ruby/1.9.3/bundler/gems/rubocop-e9fa7563d4ea/rubocop.gemspec
55
- I, [2014-02-23T15:28:09.199035 #18519] INFO -- : 0: guard-rubocop (0.2.0) from /home/arne/.gem/ruby/1.9.3/specifications/guard-rubocop-0.2.0.gemspec
56
- I, [2014-02-23T15:28:09.199575 #18519] INFO -- : 0: mini_portile (0.5.2) from /home/arne/.gem/ruby/1.9.3/specifications/mini_portile-0.5.2.gemspec
57
- I, [2014-02-23T15:28:09.199953 #18519] INFO -- : 0: nokogiri (1.6.1) from /home/arne/.gem/ruby/1.9.3/specifications/nokogiri-1.6.1.gemspec
58
- I, [2014-02-23T15:28:09.200312 #18519] INFO -- : 0: sass (3.2.14) from /home/arne/.gem/ruby/1.9.3/specifications/sass-3.2.14.gemspec
59
- I, [2014-02-23T15:28:09.289237 #18519] INFO -- : 0: hexp (0.3.1) from /home/arne/github/hexp/hexp.gemspec
60
- I, [2014-02-23T15:28:09.289793 #18519] INFO -- : 0: kramdown (1.1.0) from /home/arne/.gem/ruby/1.9.3/specifications/kramdown-1.1.0.gemspec
61
- I, [2014-02-23T15:28:09.290207 #18519] INFO -- : 0: libnotify (0.8.1) from /home/arne/.gem/ruby/1.9.3/specifications/libnotify-0.8.1.gemspec
62
- I, [2014-02-23T15:28:09.290610 #18519] INFO -- : 0: rb-fchange (0.0.6) from /home/arne/.gem/ruby/1.9.3/specifications/rb-fchange-0.0.6.gemspec
63
- I, [2014-02-23T15:28:09.291033 #18519] INFO -- : 0: rb-notifu (0.0.4) from /home/arne/.gem/ruby/1.9.3/specifications/rb-notifu-0.0.4.gemspec
64
- I, [2014-02-23T15:28:09.291431 #18519] INFO -- : 0: rbench (0.2.3) from /home/arne/.gem/ruby/1.9.3/specifications/rbench-0.2.3.gemspec
65
- I, [2014-02-23T15:28:09.291823 #18519] INFO -- : 0: ruby2ruby (2.0.6) from /home/arne/.gem/ruby/1.9.3/specifications/ruby2ruby-2.0.6.gemspec
66
- I, [2014-02-23T15:28:09.427555 #18519] INFO -- : 0: reek (1.3.1) from /home/arne/.gem/ruby/1.9.3/bundler/gems/reek-ae4d09078ae2/reek.gemspec
67
- I, [2014-02-23T15:28:09.552134 #18519] INFO -- : 0: slippery (0.0.3) from /home/arne/github/slippery/slippery.gemspec
68
- I, [2014-02-23T15:28:09.552653 #18519] INFO -- : 0: terminal-notifier-guard (1.5.3) from /home/arne/.gem/ruby/1.9.3/specifications/terminal-notifier-guard-1.5.3.gemspec
69
- I, [2014-02-23T15:28:12.704415 #18519] INFO -- : 0: yard (0.8.6.2) from /home/arne/.gem/ruby/1.9.3/specifications/yard-0.8.6.2.gemspec
70
- I, [2014-02-23T15:28:12.705047 #18519] INFO -- : 0: yard-spellcheck (0.1.5) from /home/arne/.gem/ruby/1.9.3/specifications/yard-spellcheck-0.1.5.gemspec
71
- I, [2014-02-23T15:28:14.853347 #18519] INFO -- : 0: yardstick (0.9.6) from /home/arne/.gem/ruby/1.9.3/specifications/yardstick-0.9.6.gemspec
@@ -1,59 +0,0 @@
1
- # encoding: utf-8
2
-
3
- group :development do
4
- gem 'rake', '~> 10.1.0'
5
- gem 'rspec', '~> 2.14.1'
6
- gem 'yard', '~> 0.8.6.2'
7
- end
8
-
9
- group :yard do
10
- gem 'kramdown', '~> 1.1.0'
11
- end
12
-
13
- group :guard do
14
- gem 'guard', '~> 1.8.1'
15
- gem 'guard-bundler', '~> 1.0.0'
16
- gem 'guard-rspec', '~> 3.0.2'
17
- gem 'guard-rubocop', '~> 0.2.0'
18
- gem 'guard-mutant', '~> 0.0.1'
19
-
20
- # file system change event handling
21
- gem 'listen', '~> 1.2.2'
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
25
-
26
- # notification handling
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
30
- end
31
-
32
- group :metrics do
33
- gem 'coveralls', '~> 0.6.7'
34
- gem 'flay', '~> 2.3.1'
35
- gem 'flog', '~> 4.1.1'
36
- gem 'reek', '~> 1.3.1', git: 'https://github.com/troessner/reek.git'
37
- gem 'rubocop', '~> 0.10.0', git: 'https://github.com/bbatsov/rubocop.git'
38
- gem 'simplecov', '~> 0.7.1'
39
- gem 'yardstick', '~> 0.9.6'
40
-
41
- platforms :ruby_19, :ruby_20 do
42
- gem 'mutant', '~> 0.3.0.beta18'
43
- gem 'yard-spellcheck', '~> 0.1.5'
44
- end
45
-
46
- platforms :rbx do
47
- gem 'pelusa', '~> 0.2.2'
48
- end
49
- end
50
-
51
- group :benchmarks do
52
- gem 'rbench', '~> 0.2.3'
53
- end
54
-
55
- platform :jruby do
56
- group :jruby do
57
- gem 'jruby-openssl', '~> 0.8.5'
58
- end
59
- end
@@ -1,22 +0,0 @@
1
- # Manage the assets and their URI/path
2
- module Slippery
3
- module Assets
4
- ASSETS_PATH = ROOT.join('assets')
5
-
6
- # Copies the assets locally
7
- def self.embed_locally
8
- raise 'damn'
9
- FileUtils.cp_r(ASSETS_PATH, './')
10
- end
11
-
12
- # returns a composer returning a URI for a given relative file path
13
- # considering if the asset is local or not
14
- def self.path_composer(local)
15
- if local
16
- ->(path) { File.join('assets', path) }
17
- else
18
- ->(path) { "file://#{File.expand_path(File.join(ASSETS_PATH, path), __FILE__)}" }
19
- end
20
- end
21
- end
22
- end
@@ -1,62 +0,0 @@
1
- require 'base64'
2
- require 'open-uri'
3
-
4
- module Slippery
5
- module Processors
6
- class SelfContained
7
- def self.call(doc)
8
- self.new.call(doc)
9
- end
10
-
11
- def call(doc)
12
- doc
13
- .rewrite('link[rel=stylesheet]', &convert_stylesheet_to_inline)
14
- .rewrite('script[src]', &convert_script_to_inline)
15
- .rewrite('img', &convert_image_to_data_uri)
16
- #.rewrite('style', &convert_style_uri_to_data_uri)
17
- end
18
-
19
- def convert_stylesheet_to_inline
20
- ->(link) { H[:style, { type: 'text/css' }, read_uri(link[:href])] }
21
- end
22
-
23
- def convert_script_to_inline
24
- ->(script) do
25
- attrs = script.attributes.reject { |k,v| k=='src' }
26
- H[:script, attrs, read_uri(script[:src])]
27
- end
28
- end
29
-
30
- def convert_image_to_data_uri
31
- ->(img) { H[:img, img.attributes.merge(src: data_uri(img[:src]))] }
32
- end
33
-
34
- # def convert_style_uri_to_data_uri
35
- # ->(style) {
36
- # H[:style, style.attributes, style.children.first.gsub(/url\(['"]?[^'"\)]+['"]?\)/) {|url| "url('#{data_uri url[/url\(['"]?([^'"\)]+)/,1] }')"} ] }
37
- # end
38
-
39
- def read_uri(uri)
40
- @@download_cache ||= {}
41
- if uri =~ /http/
42
- @@download_cache[uri] ||= open(uri.sub('file://', '')).read
43
- else
44
- open(uri.sub('file://', '')).read
45
- end
46
- end
47
-
48
- def data_uri(uri)
49
- base64 = Base64.encode64(read_uri uri)
50
- ext = File.extname(uri)
51
- type = {
52
- '.jpg' => 'image/jpeg',
53
- '.jpeg' => 'image/jpeg',
54
- '.png' => 'image/png',
55
- '.gif' => 'image/gif',
56
- }[ext.downcase]
57
-
58
- "data:#{type};base64,#{base64}"
59
- end
60
- end
61
- end
62
- end
File without changes