Module: Mwc
- Defined in:
- lib/mwc.rb,
lib/mwc/tasks.rb,
lib/mwc/config.rb,
lib/mwc/server.rb,
lib/mwc/command.rb,
lib/mwc/version.rb,
lib/mwc/environment.rb,
lib/mwc/utils/option.rb,
lib/mwc/commands/init.rb,
lib/mwc/options/mruby.rb,
lib/mwc/utils/command.rb,
lib/mwc/commands/watch.rb,
lib/mwc/commands/server.rb,
lib/mwc/compile_options.rb,
lib/mwc/options/project.rb,
lib/mwc/commands/compile.rb,
lib/mwc/utils/hash_accessor.rb,
lib/mwc/utils/command_registry.rb
Overview
WebAssembly compile tool for mruby
Defined Under Namespace
Modules: Commands, Options, Utils Classes: Command, CompileOptions, Config, Environment, Server, Tasks
Constant Summary collapse
- LOCK =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Mutex.new
- VERSION =
'0.4.0'
Class Method Summary collapse
-
.config ⇒ Mwc::Config
private
The mwc config.
-
.config=(path) ⇒ Object
private
Set config.
-
.environment ⇒ Mwc::Environment
private
Current environment.
-
.mruby ⇒ Mwc::Options::MRuby
private
Current mruby preferences.
-
.project ⇒ Mwc::Options::Project
private
Current project preferences.
-
.root ⇒ Pathname
private
The project root.
-
.root=(path) ⇒ Object
private
Set project root.
-
.source_root ⇒ String
private
The thor template source root.
-
.use(env, &_block) ⇒ Object
private
Use prefer environment.
Class Method Details
.config ⇒ Mwc::Config
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The mwc config
44 45 46 |
# File 'lib/mwc.rb', line 44 def self.config @config ||= Config.new end |
.config=(path) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Set config
54 55 56 |
# File 'lib/mwc.rb', line 54 def self.config=(path) @config = Config.new(path) end |
.environment ⇒ Mwc::Environment
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Current environment
94 95 96 97 98 |
# File 'lib/mwc.rb', line 94 def self.environment return config.default if @env.nil? config.environments[@env] || config.default end |
.mruby ⇒ Mwc::Options::MRuby
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Current mruby preferences
106 107 108 |
# File 'lib/mwc.rb', line 106 def self.mruby environment.mruby end |
.project ⇒ Mwc::Options::Project
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Current project preferences
116 117 118 |
# File 'lib/mwc.rb', line 116 def self.project environment.project end |
.root ⇒ Pathname
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The project root
20 21 22 23 24 25 26 |
# File 'lib/mwc.rb', line 20 def self.root return @root unless @root.nil? @root ||= Pathname.pwd @root ||= Bundler.root if defined?(::Bundler) @root end |
.root=(path) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Set project root
34 35 36 |
# File 'lib/mwc.rb', line 34 def self.root=(path) @root = Pathname.new(path) end |
.source_root ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The thor template source root
64 65 66 67 68 69 |
# File 'lib/mwc.rb', line 64 def self.source_root Pathname .new(File.dirname(__FILE__)) .join('mwc', 'templates') .to_s end |
.use(env, &_block) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Use prefer environment
78 79 80 81 82 83 84 |
# File 'lib/mwc.rb', line 78 def self.use(env, &_block) LOCK.synchronize do @env = env&.to_sym yield @env = nil end end |