hack_cards 0.0.3 → 0.0.4
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.
- checksums.yaml +4 -4
- data/hack_cards.gemspec +1 -1
- data/lib/generators/hack_cards/USAGE +8 -0
- data/lib/generators/hack_cards/hack_cards_generator.rb +20 -0
- data/lib/generators/hack_cards/templates/card.html.erb +2 -0
- data/lib/generators/hack_cards/templates/stylesheet.scss +3 -0
- data/lib/hack_cards.rb +0 -7
- data/lib/hack_cards/version.rb +1 -1
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0c1944814693f49827ee87820ebf6684274776f
|
4
|
+
data.tar.gz: 4261cf3646897b53178b81544daaf74ec63f980d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d6d3cc46f7a600a1b467331d3402312bd0d711cfe9e5db97fba0eb8932226f1cda77787df4522c5445e38d8d7a917cc0cc8318fe34aaa1c1ac7407e77266501
|
7
|
+
data.tar.gz: c50613640c17915211b667f378311d6e4089a2c454a29f25d6a69e7f3a649dd64852381d19bf97fef7d0e5133f72bac0d7bcd7b643e4f3669f1ffb9436a8fecb
|
data/hack_cards.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["michaelbyrdsemail@gmail.com"]
|
11
11
|
spec.summary = %q{A gem to help create media cards.}
|
12
12
|
spec.description = %q{}
|
13
|
-
spec.homepage = ""
|
13
|
+
spec.homepage = "https://github.com/michaelbyrd/hack_cards"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0")
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# class HackCardsGenerator < Rails::Generators::NamedBase don't take in a name
|
2
|
+
# parameter
|
3
|
+
|
4
|
+
# railscast 218
|
5
|
+
|
6
|
+
class HackCardsGenerator < Rails::Generators::Base
|
7
|
+
source_root File.expand_path('../templates', __FILE__)
|
8
|
+
argument :layout_name, type: :string, default: "cards"
|
9
|
+
|
10
|
+
# all public methods inside a generator will be executed when you call the
|
11
|
+
# generator
|
12
|
+
|
13
|
+
def generate_stylesheets
|
14
|
+
copy_file "stylesheet.scss", "app/assets/stylsheets/#{layout_name}.scss"
|
15
|
+
end
|
16
|
+
|
17
|
+
def generate_partials
|
18
|
+
template "card.html.erb", "app/views/layouts/card.html.erb"
|
19
|
+
end
|
20
|
+
end
|
data/lib/hack_cards.rb
CHANGED
@@ -1,17 +1,10 @@
|
|
1
1
|
require "hack_cards/version"
|
2
2
|
|
3
|
-
# This is Documentation for the file itself
|
4
|
-
|
5
|
-
# This is gem level documentation
|
6
3
|
module HackCards
|
7
4
|
|
8
|
-
# This is class level documentation
|
9
5
|
class Card
|
10
|
-
|
11
|
-
# text, url, and image are readable and writable fields
|
12
6
|
attr_accessor :text, :url, :image
|
13
7
|
|
14
|
-
# this is documentation for the initialize method
|
15
8
|
def initialize(image: "", text: "", url: "")
|
16
9
|
@image = image if image.length > 0
|
17
10
|
@text = text if text.length > 0
|
data/lib/hack_cards/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hack_cards
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MichaelByrd
|
@@ -51,11 +51,15 @@ files:
|
|
51
51
|
- README.md
|
52
52
|
- Rakefile
|
53
53
|
- hack_cards.gemspec
|
54
|
+
- lib/generators/hack_cards/USAGE
|
55
|
+
- lib/generators/hack_cards/hack_cards_generator.rb
|
56
|
+
- lib/generators/hack_cards/templates/card.html.erb
|
57
|
+
- lib/generators/hack_cards/templates/stylesheet.scss
|
54
58
|
- lib/hack_cards.rb
|
55
59
|
- lib/hack_cards/version.rb
|
56
60
|
- test/hack_cards_test.rb
|
57
61
|
- test/test_helper.rb
|
58
|
-
homepage:
|
62
|
+
homepage: https://github.com/michaelbyrd/hack_cards
|
59
63
|
licenses:
|
60
64
|
- MIT
|
61
65
|
metadata: {}
|
@@ -82,3 +86,4 @@ summary: A gem to help create media cards.
|
|
82
86
|
test_files:
|
83
87
|
- test/hack_cards_test.rb
|
84
88
|
- test/test_helper.rb
|
89
|
+
has_rdoc:
|