kyper_rails 0.0.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: acb8eadfde660b06800519e8e358707928ebbeeedaccc4df8f9ff46743efe4e0
4
+ data.tar.gz: bc0c1c1a00014d738dc139c519322226e23f8ef31972298d7f3cce799cbee72d
5
+ SHA512:
6
+ metadata.gz: 38b8a1baa500d3e8c70aa3a15744c70279cbc11e6762d4f23fafd90bbca4b7c26042da2979828ff559ace8247192794a40f1a797e8cbeefd3ec009450914fd47
7
+ data.tar.gz: 41c5b21d8de404d15d562c03c444636cc7994afcefdec0b81a7bb7d95ba79564ca07d208b9139fad90d022ade09d1d3f678e02dc63a1189b0eca3642c4ed261c
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ require 'rake/testtask'
2
+
3
+ Rake::TestTask.new do |t|
4
+ t.libs << 'test'
5
+ end
6
+
7
+ desc "Run tests"
8
+ task :default => :test
data/bin/kyper_rails ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'kyper_rails'
4
+ puts KyperRails.scss(ARGV[0])
@@ -0,0 +1,8 @@
1
+ class KyperRails
2
+ def self.scss(name)
3
+ theme = Theme.new(name)
4
+ theme.scss
5
+ end
6
+ end
7
+
8
+ require 'kyper_rails/theme'
@@ -0,0 +1,16 @@
1
+ class KyperRails::Theme
2
+ def initialize(name = "light")
3
+ @name = name
4
+ end
5
+
6
+ def scss
7
+ case @name
8
+ when "light"
9
+ "scss/light.scss"
10
+ when "dark"
11
+ "scss/dark.scss"
12
+ else
13
+ "ERROR: Unknown theme '%{name}' (try 'light' or 'dark' instead)" % {name: @name}
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ require 'test/unit'
2
+ require 'kyper_rails'
3
+
4
+ class KyperRailsTest < Test::Unit::TestCase
5
+ def test_scss_light
6
+ assert_equal "scss/light.scss", KyperRails.scss("light")
7
+ end
8
+
9
+ def test_scss_dark
10
+ assert_equal "scss/dark.scss", KyperRails.scss("dark")
11
+ end
12
+
13
+ def test_scss_error
14
+ assert_equal "ERROR: Unknown theme 'crunchy' (try 'light' or 'dark' instead)", KyperRails.scss("crunchy")
15
+ end
16
+ end
metadata ADDED
@@ -0,0 +1,51 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: kyper_rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Dave Alger
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-05-25 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: |2
14
+ KyperRails is a utility for using the latest `mx-design-tokens` inside of rails projects.
15
+ It also holds a subset of the MX Kyper Design System written in React.
16
+ email: me@davealger.com
17
+ executables: []
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - Rakefile
22
+ - bin/kyper_rails
23
+ - lib/kyper_rails.rb
24
+ - lib/kyper_rails/theme.rb
25
+ - test/test_kyper_rails.rb
26
+ homepage: https://kyper.netlify.app/
27
+ licenses:
28
+ - MIT
29
+ metadata: {}
30
+ post_install_message:
31
+ rdoc_options: []
32
+ require_paths:
33
+ - lib
34
+ required_ruby_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ required_rubygems_version: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: 2.0.0
44
+ requirements: []
45
+ rubyforge_project:
46
+ rubygems_version: 2.7.10
47
+ signing_key:
48
+ specification_version: 4
49
+ summary: MX Kyper Design System for Ruby on Rails!
50
+ test_files:
51
+ - test/test_kyper_rails.rb