snails 0.1.9 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/lib/snails/app.rb +2 -2
- data/lib/snails/rspec.rb +9 -1
- data/lib/snails.rb +7 -2
- data/snails.gemspec +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ab3513b9c123ab48d240332a7d065867a37aa1e
|
4
|
+
data.tar.gz: d0631690d2f6c57636dafea1e5c6a1803f68fa6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c74964dd253df391741e6daba7d8dc7e802280a363bc639f2846e92d7e6caaca4e3600ab58724526fafa44042e638d02e9518b2c450f2c6e0b8e4604252cb9a
|
7
|
+
data.tar.gz: 9840ba4d2517a9396835d732b0a6b46f5da5c4c326f3e52b6d15374075c00178a44e807fa2de9147f9378793dbdb4dd8699e39f87b354625ae17f6b25ee7a4f0
|
data/Gemfile
ADDED
data/lib/snails/app.rb
CHANGED
@@ -284,7 +284,7 @@ module Snails
|
|
284
284
|
def delete_link(options = {})
|
285
285
|
post_button(options[:text], options[:path], options.merge({
|
286
286
|
input_html: "<input type='hidden' name='_method' value='delete' />",
|
287
|
-
css_class: 'danger'
|
287
|
+
css_class: options[:css_class] || 'danger'
|
288
288
|
}))
|
289
289
|
end
|
290
290
|
|
@@ -397,7 +397,7 @@ module Snails
|
|
397
397
|
module RelativeTime
|
398
398
|
|
399
399
|
def self.minutes_in_words(min)
|
400
|
-
case min
|
400
|
+
case min.to_i
|
401
401
|
when 0..1 then 'menos de un min'
|
402
402
|
when 2..4 then 'menos de 5 min'
|
403
403
|
when 5..14 then 'menos de 15 min'
|
data/lib/snails/rspec.rb
CHANGED
@@ -6,7 +6,15 @@ require 'rubygems'
|
|
6
6
|
require 'bundler'
|
7
7
|
Bundler.require(:default, :test)
|
8
8
|
|
9
|
-
RSpec.configure do |config|
|
9
|
+
RSpec.configure do |config|
|
10
10
|
config.formatter = :fuubar
|
11
11
|
config.color = true
|
12
|
+
|
13
|
+
config.before(:suite) do
|
14
|
+
db_schema = "./db/schema.rb"
|
15
|
+
if File.exist?(db_schema) and ActiveRecord::Base.connection.instance_variable_get('@config')[:database] == ':memory:'
|
16
|
+
puts "Loading in-memory database schema."
|
17
|
+
load db_schema
|
18
|
+
end
|
19
|
+
end
|
12
20
|
end
|
data/lib/snails.rb
CHANGED
@@ -3,12 +3,17 @@ require 'pathname'
|
|
3
3
|
require 'active_support/string_inquirer'
|
4
4
|
|
5
5
|
module Snails
|
6
|
+
class EnvInquirer < ActiveSupport::StringInquirer
|
7
|
+
def dev?; development?; end
|
8
|
+
def prod?; production?; end
|
9
|
+
end
|
10
|
+
|
6
11
|
def self.root
|
7
12
|
@root ||= Pathname.new(Dir.pwd)
|
8
13
|
end
|
9
14
|
|
10
15
|
def self.env
|
11
|
-
@env ||=
|
16
|
+
@env ||= EnvInquirer.new(ENV['RACK_ENV'] || ENV['RAILS_ENV'] || 'development')
|
12
17
|
end
|
13
18
|
|
14
19
|
def self.apps
|
@@ -25,5 +30,5 @@ module Snails
|
|
25
30
|
end
|
26
31
|
end
|
27
32
|
|
28
|
-
require 'snails/app'
|
33
|
+
# require 'snails/app'
|
29
34
|
puts "Loaded #{Snails.env} environment."
|
data/snails.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomás Pollak
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01-
|
11
|
+
date: 2019-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -150,6 +150,7 @@ extensions: []
|
|
150
150
|
extra_rdoc_files: []
|
151
151
|
files:
|
152
152
|
- ".gitignore"
|
153
|
+
- Gemfile
|
153
154
|
- Rakefile
|
154
155
|
- example/Gemfile
|
155
156
|
- example/Rakefile
|