mimi 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mimi/cli.rb +1 -0
- data/lib/mimi/cli/app_generator.rb +8 -1
- data/lib/mimi/cli/template/Gemfile +7 -1
- data/lib/mimi/cli/template/app.rspec +1 -0
- data/lib/mimi/cli/template/bin/start +1 -1
- data/lib/mimi/cli/template/lib/file_name/application.rb +12 -0
- data/lib/mimi/cli/template/spec/fixtures/env.test +2 -0
- data/lib/mimi/cli/template/spec/lib/app_name/.keep +0 -0
- data/lib/mimi/cli/template/spec/lib/app_name_spec.rb +11 -0
- data/lib/mimi/cli/template/spec/spec_helper.rb +17 -0
- data/lib/mimi/cli/template/spec/support/envvars.rb +17 -0
- data/lib/mimi/cli/template/spec/support/fixtures.rb +19 -0
- data/lib/mimi/version.rb +1 -1
- data/lib/tasks/spec.rake +2 -0
- metadata +9 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3cb650154b6f2253fffc97c567d1ee37c6822cb5
|
4
|
+
data.tar.gz: 6f12c2d26093edaaaaed1eecc9dc9b0f10690b3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 775b3577fc83e6a4259ee100db22cd5f809b17995c1edc197d861103114a32b42b648d9682f404cd5c6a05c7201b16455e8badb11e389ed3826d45c25c1dc54c
|
7
|
+
data.tar.gz: 30ce3f343c257884c55c02f48fe3b667bef04ab6ddda15be46dd5a780469070b335c2e96c5ac73dac4407e7bc08f53eedbf5327cc5fa7b54bfa44780c85cfff9
|
data/lib/mimi/cli.rb
CHANGED
@@ -14,10 +14,17 @@ module Mimi
|
|
14
14
|
'lib/file_name/application.rb' => 'lib/#{file_name}/application.rb',
|
15
15
|
'lib/file_name/version.rb' => 'lib/#{file_name}/version.rb',
|
16
16
|
'lib/boot.rb' => 'lib/boot.rb',
|
17
|
+
'spec/fixtures/' => 'spec/fixtures/',
|
18
|
+
'spec/lib/app_name_spec.rb' => 'spec/lib/#{app_name}_spec.rb',
|
19
|
+
'spec/lib/app_name/' => 'spec/lib/#{app_name}/',
|
20
|
+
'spec/support/envvars.rb' => 'spec/support/envvars.rb',
|
21
|
+
'spec/support/fixtures.rb' => 'spec/support/fixtures.rb',
|
22
|
+
'spec/spec_helper.rb' => 'spec/spec_helper.rb',
|
17
23
|
'Gemfile' => 'Gemfile',
|
18
24
|
'Rakefile' => 'Rakefile',
|
19
25
|
'app.env' => '.env',
|
20
|
-
'app.gitignore' => '.gitignore'
|
26
|
+
'app.gitignore' => '.gitignore',
|
27
|
+
'app.rspec' => '.rspec'
|
21
28
|
}
|
22
29
|
FILE_MAPPINGS_EXEC = ['bin/start']
|
23
30
|
|
@@ -1,8 +1,14 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
gem 'mimi', '~>
|
3
|
+
gem 'mimi', '~> <%= Mimi::VERSION.sub(/\.\d+$/,'') %>'
|
4
4
|
|
5
5
|
# Uncomment these lines to use mimi-db or mimi-messaging:
|
6
6
|
#
|
7
7
|
# gem 'mimi/db', '~> 0.1'
|
8
8
|
# gem 'mimi/messaging', '~> 0.1'
|
9
|
+
|
10
|
+
group :development do
|
11
|
+
gem 'rake', '~> 10.5'
|
12
|
+
gem 'pry', '~> 0.10'
|
13
|
+
gem 'rspec', '~> 3.4'
|
14
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
--format documentation --color
|
@@ -10,4 +10,16 @@ class <%= module_name %>::Application < Mimi::Application
|
|
10
10
|
# use Mimi::DB
|
11
11
|
# use Mimi::Messaging
|
12
12
|
end
|
13
|
+
|
14
|
+
on :start do
|
15
|
+
logger.info "** #{self.class.name_version} started"
|
16
|
+
end
|
17
|
+
|
18
|
+
every 1.second do
|
19
|
+
logger.info "** tick"
|
20
|
+
end
|
21
|
+
|
22
|
+
on :stop do
|
23
|
+
logger.info "** #{self.class.name_version} stopped"
|
24
|
+
end
|
13
25
|
end # class <%= module_name %>::Application
|
File without changes
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'bundler/setup'
|
2
|
+
Bundler.setup
|
3
|
+
$LOAD_PATH.unshift(__dir__)
|
4
|
+
|
5
|
+
require_relative '../lib/<%= file_name %>'
|
6
|
+
require 'support/fixtures'
|
7
|
+
require 'support/envvars'
|
8
|
+
|
9
|
+
with_env_vars(fixture_path('env.test')) do
|
10
|
+
# Load and configure application
|
11
|
+
end
|
12
|
+
|
13
|
+
RSpec.configure do |config|
|
14
|
+
config.expect_with :rspec do |c|
|
15
|
+
c.syntax = :expect
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'dotenv'
|
2
|
+
|
3
|
+
# Runs block with ENV variables loaded from specified file,
|
4
|
+
# restores original ENV variables after.
|
5
|
+
#
|
6
|
+
# @example
|
7
|
+
# with_env_vars('.env.test') do
|
8
|
+
# application.config.load
|
9
|
+
# end
|
10
|
+
#
|
11
|
+
def with_env_vars(filename = nil, &_block)
|
12
|
+
original_env_vars = ENV.to_hash
|
13
|
+
Dotenv.load(filename) if filename
|
14
|
+
yield
|
15
|
+
ensure
|
16
|
+
ENV.replace(original_env_vars)
|
17
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'pathname'
|
2
|
+
|
3
|
+
# Returns pathname of the given fixture or folder in fixtures
|
4
|
+
#
|
5
|
+
def fixture_path(*name)
|
6
|
+
Pathname.pwd.join('spec', 'fixtures', *name)
|
7
|
+
end
|
8
|
+
|
9
|
+
# Reads and returns fixture contents as a String.
|
10
|
+
#
|
11
|
+
def fixture(name)
|
12
|
+
File.read(fixture_path(name))
|
13
|
+
end
|
14
|
+
|
15
|
+
# Reads and returns fixture contents parsed from a JSON string.
|
16
|
+
#
|
17
|
+
def fixture_json(name)
|
18
|
+
JSON.parse(fixture("#{name}.json"))
|
19
|
+
end
|
data/lib/mimi/version.rb
CHANGED
data/lib/tasks/spec.rake
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mimi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Kukushkin
|
@@ -151,6 +151,7 @@ files:
|
|
151
151
|
- lib/mimi/cli/template/Rakefile
|
152
152
|
- lib/mimi/cli/template/app.env
|
153
153
|
- lib/mimi/cli/template/app.gitignore
|
154
|
+
- lib/mimi/cli/template/app.rspec
|
154
155
|
- lib/mimi/cli/template/app/messaging/README.md
|
155
156
|
- lib/mimi/cli/template/app/models/README.md
|
156
157
|
- lib/mimi/cli/template/bin/start
|
@@ -159,11 +160,18 @@ files:
|
|
159
160
|
- lib/mimi/cli/template/lib/file_name.rb
|
160
161
|
- lib/mimi/cli/template/lib/file_name/application.rb
|
161
162
|
- lib/mimi/cli/template/lib/file_name/version.rb
|
163
|
+
- lib/mimi/cli/template/spec/fixtures/env.test
|
164
|
+
- lib/mimi/cli/template/spec/lib/app_name/.keep
|
165
|
+
- lib/mimi/cli/template/spec/lib/app_name_spec.rb
|
166
|
+
- lib/mimi/cli/template/spec/spec_helper.rb
|
167
|
+
- lib/mimi/cli/template/spec/support/envvars.rb
|
168
|
+
- lib/mimi/cli/template/spec/support/fixtures.rb
|
162
169
|
- lib/mimi/console.rb
|
163
170
|
- lib/mimi/version.rb
|
164
171
|
- lib/tasks/config.rake
|
165
172
|
- lib/tasks/console.rake
|
166
173
|
- lib/tasks/core.rake
|
174
|
+
- lib/tasks/spec.rake
|
167
175
|
- mimi.gemspec
|
168
176
|
homepage: https://github.com/kukushkin/mimi
|
169
177
|
licenses:
|