x_ray 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3ba263055f64349cb970f3aa97de6b3ed04fcddb
4
+ data.tar.gz: 1cc1ca3b1389acf4942f5330074e20985319ae0b
5
+ SHA512:
6
+ metadata.gz: 7d002cd96e34d30811531e3f4884c1ec8f6eabb88125cbf34ea48d025e9766bbb1bdcea9dc8f90e23d1cb7ade02ef0dc17d6f652a97cc998952922581928092b
7
+ data.tar.gz: 574f3b3ef0258aa31cb720b9d01c35ba16cdaca19f931dbb254db2284b076faa32b3d7123ed802aa8e6626aa909f58261d048e5f12b636f3636baa388c4fc2b5
data/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ .bundle/
2
+ log/*.log
3
+ pkg/
4
+ test/dummy/db/*.sqlite3
5
+ test/dummy/db/*.sqlite3-journal
6
+ test/dummy/log/*.log
7
+ test/dummy/tmp/
8
+ test/dummy/.sass-cache
9
+ *.gem
10
+ .DS_Store
data/Gemfile ADDED
@@ -0,0 +1,15 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Declare your gem's dependencies in x_ray.gemspec.
4
+ # Bundler will treat runtime dependencies like base dependencies, and
5
+ # development dependencies will be added by default to the :development group.
6
+ gemspec
7
+
8
+ # Declare any dependencies that are still in development here instead of in
9
+ # your gemspec. These might include edge Rails or gems from your path or
10
+ # Git. Remember to move these dependencies to your gemspec before releasing
11
+ # your gem to rubygems.org.
12
+
13
+ # To use a debugger
14
+ # gem 'byebug', group: [:development, :test]
15
+
data/Gemfile.lock ADDED
@@ -0,0 +1,110 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ x-ray (0.0.1)
5
+ rails (~> 4.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actionmailer (4.2.6)
11
+ actionpack (= 4.2.6)
12
+ actionview (= 4.2.6)
13
+ activejob (= 4.2.6)
14
+ mail (~> 2.5, >= 2.5.4)
15
+ rails-dom-testing (~> 1.0, >= 1.0.5)
16
+ actionpack (4.2.6)
17
+ actionview (= 4.2.6)
18
+ activesupport (= 4.2.6)
19
+ rack (~> 1.6)
20
+ rack-test (~> 0.6.2)
21
+ rails-dom-testing (~> 1.0, >= 1.0.5)
22
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
23
+ actionview (4.2.6)
24
+ activesupport (= 4.2.6)
25
+ builder (~> 3.1)
26
+ erubis (~> 2.7.0)
27
+ rails-dom-testing (~> 1.0, >= 1.0.5)
28
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
29
+ activejob (4.2.6)
30
+ activesupport (= 4.2.6)
31
+ globalid (>= 0.3.0)
32
+ activemodel (4.2.6)
33
+ activesupport (= 4.2.6)
34
+ builder (~> 3.1)
35
+ activerecord (4.2.6)
36
+ activemodel (= 4.2.6)
37
+ activesupport (= 4.2.6)
38
+ arel (~> 6.0)
39
+ activesupport (4.2.6)
40
+ i18n (~> 0.7)
41
+ json (~> 1.7, >= 1.7.7)
42
+ minitest (~> 5.1)
43
+ thread_safe (~> 0.3, >= 0.3.4)
44
+ tzinfo (~> 1.1)
45
+ arel (6.0.3)
46
+ builder (3.2.2)
47
+ concurrent-ruby (1.0.2)
48
+ erubis (2.7.0)
49
+ globalid (0.3.6)
50
+ activesupport (>= 4.1.0)
51
+ i18n (0.7.0)
52
+ json (1.8.3)
53
+ loofah (2.0.3)
54
+ nokogiri (>= 1.5.9)
55
+ mail (2.6.4)
56
+ mime-types (>= 1.16, < 4)
57
+ mime-types (3.0)
58
+ mime-types-data (~> 3.2015)
59
+ mime-types-data (3.2016.0221)
60
+ mini_portile2 (2.0.0)
61
+ minitest (5.8.4)
62
+ nokogiri (1.6.7.2)
63
+ mini_portile2 (~> 2.0.0.rc2)
64
+ rack (1.6.4)
65
+ rack-test (0.6.3)
66
+ rack (>= 1.0)
67
+ rails (4.2.6)
68
+ actionmailer (= 4.2.6)
69
+ actionpack (= 4.2.6)
70
+ actionview (= 4.2.6)
71
+ activejob (= 4.2.6)
72
+ activemodel (= 4.2.6)
73
+ activerecord (= 4.2.6)
74
+ activesupport (= 4.2.6)
75
+ bundler (>= 1.3.0, < 2.0)
76
+ railties (= 4.2.6)
77
+ sprockets-rails
78
+ rails-deprecated_sanitizer (1.0.3)
79
+ activesupport (>= 4.2.0.alpha)
80
+ rails-dom-testing (1.0.7)
81
+ activesupport (>= 4.2.0.beta, < 5.0)
82
+ nokogiri (~> 1.6.0)
83
+ rails-deprecated_sanitizer (>= 1.0.1)
84
+ rails-html-sanitizer (1.0.3)
85
+ loofah (~> 2.0)
86
+ railties (4.2.6)
87
+ actionpack (= 4.2.6)
88
+ activesupport (= 4.2.6)
89
+ rake (>= 0.8.7)
90
+ thor (>= 0.18.1, < 2.0)
91
+ rake (11.1.2)
92
+ sprockets (3.6.0)
93
+ concurrent-ruby (~> 1.0)
94
+ rack (> 1, < 3)
95
+ sprockets-rails (3.0.4)
96
+ actionpack (>= 4.0)
97
+ activesupport (>= 4.0)
98
+ sprockets (>= 3.0.0)
99
+ sqlite3 (1.3.11)
100
+ thor (0.19.1)
101
+ thread_safe (0.3.5)
102
+ tzinfo (1.2.2)
103
+ thread_safe (~> 0.1)
104
+
105
+ PLATFORMS
106
+ ruby
107
+
108
+ DEPENDENCIES
109
+ sqlite3
110
+ x-ray!
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2016 tiffling
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # x_ray
2
+
3
+ A gem to help display code examples
4
+
5
+ ## Installation
6
+
7
+ Include gem in Gemfile:
8
+
9
+ ```ruby
10
+ gem 'x_ray'
11
+ ```
12
+
13
+ Import CSS file in `application.css`
14
+
15
+ ```css
16
+ @import 'x_ray/prettifier';
17
+ ```
18
+
19
+ Include helper in `application_helper.rb`
20
+
21
+ ```ruby
22
+ include XRay::Helper
23
+ ```
24
+
25
+ ## Usage
26
+
27
+ ```erb
28
+ <%= x_ray do %>
29
+ <div>
30
+ <ol>
31
+ <li>First thing</li>
32
+ <li>Second thing</li>
33
+ <li>Third thing</li>
34
+ </ol>
35
+ </div>
36
+ <% end %>
37
+ ```
@@ -0,0 +1,13 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require_tree .
@@ -0,0 +1,42 @@
1
+ $x-ray-bg-color: #eceff1;
2
+ $x-ray-border-color: darken($x-ray-bg-color, 30);
3
+ $x-ray-border-radius: 3px;
4
+
5
+ .codeExample {
6
+ border: 1px solid $x-ray-border-color;
7
+ border-radius: $x-ray-border-radius;
8
+ margin-bottom: 30px;
9
+ margin-top: 30px;
10
+
11
+ &:before {
12
+ background-color: $x-ray-bg-color;
13
+ border-bottom-left-radius: 0;
14
+ border-radius: $x-ray-border-radius;
15
+ border-top-right-radius: 0;
16
+ border: 1px solid $x-ray-border-color;
17
+ content: "EXAMPLE";
18
+ display: block;
19
+ font-size: 10px;
20
+ left: -1px;
21
+ padding: 15px;
22
+ position: relative;
23
+ top: -1px;
24
+ width: 80px;
25
+ }
26
+
27
+ pre {
28
+ margin: 0;
29
+ }
30
+ }
31
+
32
+ .exampleOutput {
33
+ padding: 20px;
34
+ }
35
+
36
+ .codeBlock {
37
+ background-color: $x-ray-bg-color;
38
+ border-top: 1px solid $x-ray-border-color;
39
+ border-bottom-left-radius: $x-ray-border-radius;
40
+ border-bottom-right-radius: $x-ray-border-radius;
41
+ padding: 20px;
42
+ }
@@ -0,0 +1,7 @@
1
+ module XRay
2
+ module Helper
3
+ def x_ray(&block)
4
+ render(layout: 'layouts/x_ray/scan', &block)
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,11 @@
1
+ <div class="codeExample">
2
+ <div class="exampleOutput">
3
+ <%= yield %>
4
+ </div>
5
+
6
+ <div class="codeBlock">
7
+ <pre>
8
+ <%= "#{yield}" %>
9
+ </pre>
10
+ </div>
11
+ </div>
data/lib/.DS_Store ADDED
Binary file
Binary file
@@ -0,0 +1,5 @@
1
+ module XRay
2
+ class Engine < Rails::Engine
3
+ isolate_namespace XRay
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ module XRay
2
+ VERSION = '0.0.1'.freeze
3
+ end
data/lib/x_ray.rb ADDED
@@ -0,0 +1,17 @@
1
+ module XRay
2
+ class << self
3
+ attr_accessor :configuration
4
+ end
5
+
6
+ def self.setup
7
+ self.configuration ||= Configuration.new
8
+ yield(configuration)
9
+ end
10
+
11
+ class Configuration
12
+ def initialize
13
+ end
14
+ end
15
+ end
16
+
17
+ require 'x_ray/engine'
@@ -0,0 +1,21 @@
1
+ # Configure Rails Environment
2
+ ENV["RAILS_ENV"] = "test"
3
+
4
+ require File.expand_path("../../test/dummy/config/environment.rb", __FILE__)
5
+ ActiveRecord::Migrator.migrations_paths = [File.expand_path("../../test/dummy/db/migrate", __FILE__)]
6
+ ActiveRecord::Migrator.migrations_paths << File.expand_path('../../db/migrate', __FILE__)
7
+ require "rails/test_help"
8
+
9
+ # Filter out Minitest backtrace while allowing backtrace from other libraries
10
+ # to be shown.
11
+ Minitest.backtrace_filter = Minitest::BacktraceFilter.new
12
+
13
+ # Load support files
14
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
15
+
16
+ # Load fixtures from the engine
17
+ if ActiveSupport::TestCase.respond_to?(:fixture_path=)
18
+ ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
19
+ ActionDispatch::IntegrationTest.fixture_path = ActiveSupport::TestCase.fixture_path
20
+ ActiveSupport::TestCase.fixtures :all
21
+ end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class XRayTest < ActiveSupport::TestCase
4
+ test "truth" do
5
+ assert_kind_of Module, XRay
6
+ end
7
+ end
data/x_ray.gemspec ADDED
@@ -0,0 +1,22 @@
1
+ $:.push File.expand_path('../lib', __FILE__)
2
+
3
+ # Maintain your gem's version:
4
+ require 'x_ray/version'
5
+
6
+ # Describe your gem and declare its dependencies:
7
+ Gem::Specification.new do |s|
8
+ s.name = 'x_ray'
9
+ s.version = XRay::VERSION.dup
10
+ s.date = '2016-05-13'
11
+ s.authors = ['Tiffany Huang']
12
+ s.email = 'tiffanylinghuang@gmail.com'
13
+ s.homepage = 'https://github.com/tiffling/x-ray'
14
+ s.summary = 'A gem to help display code examples'
15
+ s.description = 'A gem to help display code examples'
16
+ s.license = 'MIT'
17
+ s.require_paths = ['lib']
18
+ s.files = `git ls-files`.split("\n")
19
+
20
+ s.add_dependency 'rails', '~> 4.0'
21
+ s.add_development_dependency 'sqlite3'
22
+ end
metadata ADDED
@@ -0,0 +1,88 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: x_ray
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Tiffany Huang
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-05-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '4.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '4.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: sqlite3
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: A gem to help display code examples
42
+ email: tiffanylinghuang@gmail.com
43
+ executables: []
44
+ extensions: []
45
+ extra_rdoc_files: []
46
+ files:
47
+ - .gitignore
48
+ - Gemfile
49
+ - Gemfile.lock
50
+ - MIT-LICENSE
51
+ - README.md
52
+ - app/assets/javascripts/x_ray/application.js
53
+ - app/assets/stylesheets/x_ray/prettifier.scss
54
+ - app/helpers/x_ray/helper.rb
55
+ - app/views/layouts/x_ray/_scan.html.erb
56
+ - lib/.DS_Store
57
+ - lib/x_ray.rb
58
+ - lib/x_ray/.DS_Store
59
+ - lib/x_ray/engine.rb
60
+ - lib/x_ray/version.rb
61
+ - test/test_helper.rb
62
+ - test/x_ray_test.rb
63
+ - x_ray.gemspec
64
+ homepage: https://github.com/tiffling/x-ray
65
+ licenses:
66
+ - MIT
67
+ metadata: {}
68
+ post_install_message:
69
+ rdoc_options: []
70
+ require_paths:
71
+ - lib
72
+ required_ruby_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ required_rubygems_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - '>='
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ requirements: []
83
+ rubyforge_project:
84
+ rubygems_version: 2.1.10
85
+ signing_key:
86
+ specification_version: 4
87
+ summary: A gem to help display code examples
88
+ test_files: []