timeline_rails 0.1.0

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: f67e3c0bf921f86e4a87a8241545ec2a81ea9769
4
+ data.tar.gz: f33cc0729a44b580fb9a73698735e0662b27e13e
5
+ SHA512:
6
+ metadata.gz: 494dea5c05bab5e50a6d6a4bd2009af539d918333ac808eb3b289adf154191921e8e0a91776c6a120ed59239420d9c792e0f1cea37d22aec8082858ab3f44be8
7
+ data.tar.gz: 741eea4f702aa37bc3cd3b5c71176de9e68334a9f7786fa24f260c8d76d60e919d381012310ec446472dfff640429cc7b963f69a13d8c72766d11cbb56505530
data/.gitignore ADDED
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ /.idea
11
+ *.sqlite
12
+ *.gem
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.3.1
5
+ before_install: gem install bundler -v 1.12.5
@@ -0,0 +1,49 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, and in the interest of
4
+ fostering an open and welcoming community, we pledge to respect all people who
5
+ contribute through reporting issues, posting feature requests, updating
6
+ documentation, submitting pull requests or patches, and other activities.
7
+
8
+ We are committed to making participation in this project a harassment-free
9
+ experience for everyone, regardless of level of experience, gender, gender
10
+ identity and expression, sexual orientation, disability, personal appearance,
11
+ body size, race, ethnicity, age, religion, or nationality.
12
+
13
+ Examples of unacceptable behavior by participants include:
14
+
15
+ * The use of sexualized language or imagery
16
+ * Personal attacks
17
+ * Trolling or insulting/derogatory comments
18
+ * Public or private harassment
19
+ * Publishing other's private information, such as physical or electronic
20
+ addresses, without explicit permission
21
+ * Other unethical or unprofessional conduct
22
+
23
+ Project maintainers have the right and responsibility to remove, edit, or
24
+ reject comments, commits, code, wiki edits, issues, and other contributions
25
+ that are not aligned to this Code of Conduct, or to ban temporarily or
26
+ permanently any contributor for other behaviors that they deem inappropriate,
27
+ threatening, offensive, or harmful.
28
+
29
+ By adopting this Code of Conduct, project maintainers commit themselves to
30
+ fairly and consistently applying these principles to every aspect of managing
31
+ this project. Project maintainers who do not follow or enforce the Code of
32
+ Conduct may be permanently removed from the project team.
33
+
34
+ This code of conduct applies both within project spaces and in public spaces
35
+ when an individual is representing the project or its community.
36
+
37
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
38
+ reported by contacting a project maintainer at thibaut.roche.perso@gmail.com. All
39
+ complaints will be reviewed and investigated and will result in a response that
40
+ is deemed necessary and appropriate to the circumstances. Maintainers are
41
+ obligated to maintain confidentiality with regard to the reporter of an
42
+ incident.
43
+
44
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
45
+ version 1.3.0, available at
46
+ [http://contributor-covenant.org/version/1/3/0/][version]
47
+
48
+ [homepage]: http://contributor-covenant.org
49
+ [version]: http://contributor-covenant.org/version/1/3/0/
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in timeline_rails.gemspec
4
+ gemspec
5
+
6
+ group :test do
7
+ gem 'coveralls', require: false
8
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Thibaut Roche
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,47 @@
1
+ [![Build Status](https://travis-ci.org/Insynia/timeline-rails.svg?branch=master)](https://travis-ci.org/Insynia/timeline-rails)
2
+ [![Coverage Status](https://coveralls.io/repos/github/Insynia/timeline-rails/badge.svg?branch=master)](https://coveralls.io/github/Insynia/timeline-rails?branch=master)
3
+ [![Code Climate](https://codeclimate.com/github/Insynia/timeline-rails/badges/gpa.svg)](https://codeclimate.com/github/Insynia/timeline-rails)
4
+ [![Dependency Status](https://gemnasium.com/badges/github.com/Insynia/timeline-rails.svg)](https://gemnasium.com/github.com/Insynia/timeline-rails)
5
+ [![security](https://hakiri.io/github/Insynia/timeline-rails/master.svg)](https://hakiri.io/github/Insynia/timeline-rails/master)
6
+
7
+ # Timeline::Rails
8
+
9
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/timeline/rails`. To experiment with that code, run `bin/console` for an interactive prompt.
10
+
11
+ TODO: Delete this and the text above, and describe your gem
12
+
13
+ ## Installation
14
+
15
+ Add this line to your application's Gemfile:
16
+
17
+ ```ruby
18
+ gem 'timeline-rails'
19
+ ```
20
+
21
+ And then execute:
22
+
23
+ $ bundle
24
+
25
+ Or install it yourself as:
26
+
27
+ $ gem install timeline-rails
28
+
29
+ ## Usage
30
+
31
+ TODO: Write usage instructions here
32
+
33
+ ## Development
34
+
35
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
36
+
37
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
38
+
39
+ ## Contributing
40
+
41
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/timeline-rails. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
42
+
43
+
44
+ ## License
45
+
46
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
47
+
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "timeline_rails"
5
+ .
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/config.ru ADDED
@@ -0,0 +1,7 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+
4
+ Bundler.require :default, :development
5
+
6
+ Combustion.initialize! :all
7
+ run Combustion::Application
@@ -0,0 +1,15 @@
1
+ require 'rails/railtie'
2
+
3
+ module TimelineRails
4
+ class Railtie < Rails::Railtie
5
+ initializer 'timeline_rails.view_helpers' do
6
+ ActionView::Base.send :include, TimelineRails::ViewHelpers
7
+ end
8
+
9
+ initializer :assets do
10
+ Rails.application.config.assets.precompile += %w{ timeline_rails.scss }
11
+ Rails.application.config.assets.paths << TimelineRails.root + '/vendor/assets/javascripts'
12
+ Rails.application.config.assets.paths << TimelineRails.root + '/vendor/assets/stylesheets'
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,3 @@
1
+ module TimelineRails
2
+ VERSION = '0.1.0'
3
+ end
@@ -0,0 +1,35 @@
1
+ require 'action_view'
2
+
3
+ module TimelineRails
4
+ module ViewHelpers
5
+ include ::ActionView::Helpers::OutputSafetyHelper
6
+ include ::ActionView::Helpers::CaptureHelper
7
+ include ::ActionView::Context
8
+
9
+ def timeline_wrapper(&block)
10
+ output = '<div class="timeline">'
11
+ output << capture(&block) if block_given?
12
+ output << '</div>'
13
+ output.html_safe
14
+ end
15
+
16
+ def timeline_block(date: nil, title: nil, preview: nil, url: nil, &block)
17
+ if block_given?
18
+ capture(&block).html_safe
19
+ else
20
+ "<div class=\"timeline-block\">
21
+ <div class=\"timeline-circle\">
22
+ <span>#{date.strftime('%d/%m')}</span>
23
+ </div>
24
+ <a href=\"#{url}\">
25
+ <div class=\"timeline-content\">
26
+ <h2>#{title}</h2>
27
+ <p>#{preview}</p>
28
+ <span class=\"cd-date\">#{::I18n.l date, format: :short}</span>
29
+ </div>
30
+ </a>
31
+ </div>".html_safe
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,10 @@
1
+ require 'i18n'
2
+ require 'timeline_rails/version'
3
+ require 'timeline_rails/view_helpers'
4
+ require 'timeline_rails/railtie' if defined?(Rails)
5
+
6
+ module TimelineRails
7
+ def self.root
8
+ File.dirname __dir__
9
+ end
10
+ end
@@ -0,0 +1,36 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'timeline_rails/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'timeline_rails'
8
+ spec.version = TimelineRails::VERSION
9
+ spec.authors = ['Thibaut Roche']
10
+ spec.email = ['thibaut.roche.perso@gmail.com']
11
+
12
+ spec.summary = %q{Allows you to build a customizable vertical timeline very easily.}
13
+ spec.description = %q{Allows you to build a customizable vertical timeline very easily.}
14
+ spec.homepage = 'https://github.com/Insynia/timeline_rails'
15
+ spec.license = 'MIT'
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.bindir = 'exe'
19
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+ spec.require_paths = ['lib']
21
+
22
+ spec.add_development_dependency 'bundler', '~> 1.12'
23
+ spec.add_development_dependency 'rake', '~> 10.0'
24
+ spec.add_development_dependency 'rspec', '~> 3.0'
25
+ spec.add_development_dependency 'combustion', '~> 0.5.4'
26
+ spec.add_development_dependency 'sqlite3'
27
+ spec.add_development_dependency 'activerecord', '>= 4.0'
28
+ spec.add_development_dependency 'actionmailer', '>= 4.0'
29
+ spec.add_development_dependency 'activesupport', '>= 4.0.0'
30
+ spec.add_development_dependency 'actionview', '>= 4.0.0'
31
+
32
+ spec.add_runtime_dependency 'i18n', '~> 0.7.0'
33
+ spec.add_runtime_dependency 'railties', '>= 4.0'
34
+ spec.add_runtime_dependency 'sass-rails', '>= 5.0'
35
+ spec
36
+ end
@@ -0,0 +1,72 @@
1
+ .timeline {
2
+ &:before {
3
+ content: '';
4
+ position: absolute;
5
+ top: 0;
6
+ left: 50%;
7
+ transform: translateX(-50%);
8
+ height: 100%;
9
+ width: 4px;
10
+ background: #d7e4ed;
11
+
12
+ @media (max-width: 767px) {
13
+ left: 65%;
14
+ }
15
+ }
16
+
17
+ .timeline-block {
18
+ clear: both;
19
+ margin-top: 20px;
20
+
21
+ .timeline-circle {
22
+ position: absolute;
23
+ left: 50%;
24
+ height: 50px;
25
+ width: 50px;
26
+ background-color: #38d9bd;
27
+ border: 4px solid rgb(240, 240, 240);
28
+ border-radius: 50%;
29
+ transform: translateX(-50%);
30
+ text-align: center;
31
+ font-weight: bold;
32
+
33
+ @media (max-width: 767px) {
34
+ left: 65%;
35
+ }
36
+
37
+ span {
38
+ font-size: 12px;
39
+ line-height: 42px;
40
+ color: rgb(240, 240, 240);
41
+ }
42
+ }
43
+
44
+ .timeline-content {
45
+ padding: 10px;
46
+ text-align: right;
47
+ border-radius: 4px;
48
+ width: 40%;
49
+ color: black;
50
+
51
+ h2 {
52
+ margin-top: 0;
53
+ }
54
+
55
+ a {
56
+ color: black;
57
+ }
58
+ }
59
+
60
+ &:nth-child(even) {
61
+ .timeline-content {
62
+ text-align: left;
63
+ float: right;
64
+
65
+ @media (max-width: 767px) {
66
+ text-align: right;
67
+ float: inherit;
68
+ }
69
+ }
70
+ }
71
+ }
72
+ }
metadata ADDED
@@ -0,0 +1,230 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: timeline_rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Thibaut Roche
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-09-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.12'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.12'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: combustion
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.5.4
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 0.5.4
69
+ - !ruby/object:Gem::Dependency
70
+ name: sqlite3
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: activerecord
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '4.0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '4.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: actionmailer
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '4.0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '4.0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: activesupport
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: 4.0.0
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: 4.0.0
125
+ - !ruby/object:Gem::Dependency
126
+ name: actionview
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: 4.0.0
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: 4.0.0
139
+ - !ruby/object:Gem::Dependency
140
+ name: i18n
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: 0.7.0
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: 0.7.0
153
+ - !ruby/object:Gem::Dependency
154
+ name: railties
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '4.0'
160
+ type: :runtime
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '4.0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: sass-rails
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '5.0'
174
+ type: :runtime
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '5.0'
181
+ description: Allows you to build a customizable vertical timeline very easily.
182
+ email:
183
+ - thibaut.roche.perso@gmail.com
184
+ executables: []
185
+ extensions: []
186
+ extra_rdoc_files: []
187
+ files:
188
+ - ".gitignore"
189
+ - ".rspec"
190
+ - ".travis.yml"
191
+ - CODE_OF_CONDUCT.md
192
+ - Gemfile
193
+ - LICENSE.txt
194
+ - README.md
195
+ - Rakefile
196
+ - bin/console
197
+ - bin/setup
198
+ - config.ru
199
+ - lib/timeline_rails.rb
200
+ - lib/timeline_rails/railtie.rb
201
+ - lib/timeline_rails/version.rb
202
+ - lib/timeline_rails/view_helpers.rb
203
+ - timeline_rails.gemspec
204
+ - vendor/assets/stylesheets/timeline_rails.scss
205
+ homepage: https://github.com/Insynia/timeline_rails
206
+ licenses:
207
+ - MIT
208
+ metadata: {}
209
+ post_install_message:
210
+ rdoc_options: []
211
+ require_paths:
212
+ - lib
213
+ required_ruby_version: !ruby/object:Gem::Requirement
214
+ requirements:
215
+ - - ">="
216
+ - !ruby/object:Gem::Version
217
+ version: '0'
218
+ required_rubygems_version: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - ">="
221
+ - !ruby/object:Gem::Version
222
+ version: '0'
223
+ requirements: []
224
+ rubyforge_project:
225
+ rubygems_version: 2.5.1
226
+ signing_key:
227
+ specification_version: 4
228
+ summary: Allows you to build a customizable vertical timeline very easily.
229
+ test_files: []
230
+ has_rdoc: