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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 50aa52965b69cf0acfebc2aa2567e3e0c8b2f538
4
- data.tar.gz: b2067e89e1fdd6082303f5c0ae276cf9d324f924
3
+ metadata.gz: 3cb650154b6f2253fffc97c567d1ee37c6822cb5
4
+ data.tar.gz: 6f12c2d26093edaaaaed1eecc9dc9b0f10690b3d
5
5
  SHA512:
6
- metadata.gz: 428879cddaf1aa447424f681612262f9718f2fe90260f172622a007ce3517de734c34564bd7ed7d692700a887b91be2f8f9461756d97cbded1ff65b44f687f14
7
- data.tar.gz: a6d47b0780faf22eee3ebba4959307e8563a377b7f90f06aebf67bfc623fd93d453f61d8277fa7cfcc01806e70e814e19b4d17fd762542969467b29caf2579a5
6
+ metadata.gz: 775b3577fc83e6a4259ee100db22cd5f809b17995c1edc197d861103114a32b42b648d9682f404cd5c6a05c7201b16455e8badb11e389ed3826d45c25c1dc54c
7
+ data.tar.gz: 30ce3f343c257884c55c02f48fe3b667bef04ab6ddda15be46dd5a780469070b335c2e96c5ac73dac4407e7bc08f53eedbf5327cc5fa7b54bfa44780c85cfff9
@@ -27,4 +27,5 @@ module Mimi
27
27
  end # class CLI
28
28
  end # module Mimi
29
29
 
30
+ require_relative './version'
30
31
  require_relative 'cli/app_generator'
@@ -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', '~> 0.1'
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
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'bundler/setup'
4
- require '<%= file_name %>'
4
+ require_relative '../lib/<%= file_name %>'
5
5
 
6
6
  Mimi::Application.run
@@ -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
@@ -0,0 +1,2 @@
1
+ # Place test environment configuration here
2
+ #
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe <%= module_name %> do
4
+ it 'supposed to be a Module ' do
5
+ expect(described_class).to be_a Module
6
+ end
7
+
8
+ it 'is a banana' do
9
+ expect(described_class).to be 'a banana'
10
+ end
11
+ end
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Mimi
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.1.1'.freeze
3
3
  end
@@ -0,0 +1,2 @@
1
+ require 'rspec/core/rake_task'
2
+ RSpec::Core::RakeTask.new(:spec)
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.0
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: