Class: Applyrics::Project
- Inherits:
-
Object
- Object
- Applyrics::Project
- Defined in:
- lib/applyrics/project.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#detected_languages ⇒ Array
An array of languages detected in the project.
-
#initialize(platform = nil, path = "") ⇒ Project
constructor
A new instance of Project.
-
#platform_project_settings(name) ⇒ String?
The value of the setting or nil if not found.
-
#rebuild_files ⇒ Object
Rebuild the language files.
Constructor Details
#initialize(platform = nil, path = "") ⇒ Project
Returns a new instance of Project.
31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/applyrics/project.rb', line 31 def initialize(platform=nil, path="") if platform.nil? platform = self.class.detected_platform end @platform = platform if @platform == :ios @project = Applyrics::Project_iOS.new(path) end end |
Class Method Details
.detected_platform ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/applyrics/project.rb', line 18 def detected_platform if is_ios? :ios elsif is_android? :android elsif is_unity? :unity else nil end end |
.is_android? ⇒ Boolean
10 11 12 |
# File 'lib/applyrics/project.rb', line 10 def is_android? Dir["*.gradle"].count > 0 end |
.is_ios? ⇒ Boolean
6 7 8 |
# File 'lib/applyrics/project.rb', line 6 def is_ios? (Dir["*.xcodeproj"] + Dir["*.xcworkspace"]).count > 0 end |
.is_unity? ⇒ Boolean
14 15 16 |
# File 'lib/applyrics/project.rb', line 14 def is_unity? false end |
Instance Method Details
#detected_languages ⇒ Array
Returns An array of languages detected in the project.
46 47 48 |
# File 'lib/applyrics/project.rb', line 46 def detected_languages @project.detected_languages() end |
#platform_project_settings(name) ⇒ String?
Returns the value of the setting or nil if not found.
52 53 54 |
# File 'lib/applyrics/project.rb', line 52 def platform_project_settings(name) @project.platform_project_settings(name) end |
#rebuild_files ⇒ Object
Rebuild the language files.
57 58 59 |
# File 'lib/applyrics/project.rb', line 57 def rebuild_files @project.rebuild_files() end |