swiper-rails 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +23 -4
- data/app/helpers/swiper_helper.rb +9 -0
- data/lib/generators/swiper/swiper_generator.rb +14 -0
- data/lib/swiper-rails/version.rb +1 -1
- data/lib/swiper-rails.rb +5 -1
- data/swiper-rails.gemspec +1 -1
- metadata +5 -3
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Swiper for Rails Asset Pipeline
|
2
2
|
|
3
|
-
|
3
|
+
[Swiper](http://www.idangero.us/sliders/swiper/) - is the free and ultra lightweight mobile touch slider. SwiperRails integrates it to yours Rails application.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -14,15 +14,34 @@ And then execute:
|
|
14
14
|
|
15
15
|
Add Swiper to your `application.css`
|
16
16
|
|
17
|
-
|
17
|
+
*= require swiper
|
18
18
|
|
19
19
|
And to `application.js`
|
20
20
|
|
21
|
-
|
21
|
+
//= require swiper
|
22
22
|
|
23
23
|
## Usage
|
24
24
|
|
25
|
-
|
25
|
+
SwiperRails has helper method, which can be useful, if you need dynamic slider.
|
26
|
+
|
27
|
+
= swiper @items { |item| item.image }
|
28
|
+
|
29
|
+
it will result the following html:
|
30
|
+
|
31
|
+
<div class="swiper-container">
|
32
|
+
<div class="swiper-wrapper">
|
33
|
+
<div class="swiper-item">
|
34
|
+
<img alt="Image1" src="/images/image1" /></div>
|
35
|
+
</div>
|
36
|
+
...
|
37
|
+
</div>
|
38
|
+
</div>
|
39
|
+
|
40
|
+
For more information about Swiper's usage check (http://www.idangero.us/sliders/swiper/api.php)
|
41
|
+
|
42
|
+
## Customizing
|
43
|
+
|
44
|
+
Run `rails g swiper`. It will copy Swiper's stylesheet to yours application and you will be able to customize styles.
|
26
45
|
|
27
46
|
## Contributing
|
28
47
|
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Swiper
|
2
|
+
module Generators
|
3
|
+
class SwiperGenerator < ::Rails::Generators::Base
|
4
|
+
|
5
|
+
source_root File.expand_path("../../../../app", __FILE__)
|
6
|
+
desc 'Copies Swiper stylesheet to your application.'
|
7
|
+
|
8
|
+
def generate_styles
|
9
|
+
copy_file "assets/stylesheets/swiper.css", "app/assets/stylesheets/swiper.css"
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/lib/swiper-rails/version.rb
CHANGED
data/lib/swiper-rails.rb
CHANGED
data/swiper-rails.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |gem|
|
|
8
8
|
gem.version = Swiper::Rails::VERSION
|
9
9
|
gem.authors = ["Nik Marchenko"]
|
10
10
|
gem.email = ["nik.marchenko@gmail.com"]
|
11
|
-
gem.description = %q{Swiper
|
11
|
+
gem.description = %q{Swiper toolkit for Rails Asset Pipeline}
|
12
12
|
gem.summary = %q{swiper-rails integrates Swiper toolkit for Rails Asset Pipeline}
|
13
13
|
gem.homepage = "https://github.com/nikmarchenko/swiper-rails"
|
14
14
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: swiper-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-05-
|
12
|
+
date: 2013-05-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -27,7 +27,7 @@ dependencies:
|
|
27
27
|
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: '3.1'
|
30
|
-
description: Swiper
|
30
|
+
description: Swiper toolkit for Rails Asset Pipeline
|
31
31
|
email:
|
32
32
|
- nik.marchenko@gmail.com
|
33
33
|
executables: []
|
@@ -41,6 +41,8 @@ files:
|
|
41
41
|
- Rakefile
|
42
42
|
- app/assets/javascripts/swiper.js
|
43
43
|
- app/assets/stylesheets/swiper.css
|
44
|
+
- app/helpers/swiper_helper.rb
|
45
|
+
- lib/generators/swiper/swiper_generator.rb
|
44
46
|
- lib/swiper-rails.rb
|
45
47
|
- lib/swiper-rails/version.rb
|
46
48
|
- swiper-rails.gemspec
|