Module: Mactag

Defined in:
lib/mactag.rb,
lib/mactag/dsl.rb,
lib/mactag/ctags.rb,
lib/mactag/errors.rb,
lib/mactag/config.rb,
lib/mactag/indexer.rb,
lib/mactag/builder.rb,
lib/mactag/bundler.rb,
lib/mactag/indexer/lib.rb,
lib/mactag/indexer/app.rb,
lib/mactag/indexer/gem.rb,
lib/mactag/indexer/rails.rb,
lib/mactag/indexer/plugin.rb

Defined Under Namespace

Modules: Config, Indexer Classes: Builder, Bundler, Ctags, Dsl, GemNotFoundError, MactagError, PluginNotFoundError

Class Method Summary collapse

Class Method Details

.configure(&block) ⇒ Object



13
14
15
# File 'lib/mactag.rb', line 13

def configure(&block)
  Mactag::Config.configure(&block)
end

.project_nameObject



35
36
37
# File 'lib/mactag.rb', line 35

def project_name
  File.basename(project_root)
end

.project_rootObject



27
28
29
30
31
32
33
# File 'lib/mactag.rb', line 27

def project_root
  if rails_app?
    ::Rails.root
  else
    ENV['PWD']
  end
end

.rails_app?Boolean



17
18
19
# File 'lib/mactag.rb', line 17

def rails_app?
  defined?(::Rails)
end

.rails_versionObject



21
22
23
24
25
# File 'lib/mactag.rb', line 21

def rails_version
  if rails_app?
    ::Rails.version
  end
end