Class: Applyrics::Project
- Inherits:
-
Object
- Object
- Applyrics::Project
- Defined in:
- lib/applyrics/project.rb
Class Method Summary collapse
Instance Method Summary collapse
- #apply_languages(data) ⇒ Object
-
#default_language ⇒ String
The language which are the default language in the project.
-
#detected_languages ⇒ Array
An array of languages detected in the project.
-
#initialize(platform = nil, path = "") ⇒ Project
constructor
A new instance of Project.
- #language_files ⇒ Object
- #platform ⇒ Object
-
#platform_project_settings(name) ⇒ String?
The value of the setting or nil if not found.
-
#rebuild_files ⇒ Object
Rebuild the language files.
-
#string_files ⇒ Object?
The strings files found in the project.
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
#apply_languages(data) ⇒ Object
75 76 77 |
# File 'lib/applyrics/project.rb', line 75 def apply_languages(data) @project.apply_languages(data) end |
#default_language ⇒ String
Returns The language which are the default language in the project.
55 56 57 |
# File 'lib/applyrics/project.rb', line 55 def default_language @project.default_language end |
#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 |
#language_files ⇒ Object
50 51 52 |
# File 'lib/applyrics/project.rb', line 50 def language_files @project.language_files() end |
#platform ⇒ Object
79 80 81 |
# File 'lib/applyrics/project.rb', line 79 def platform @platform end |
#platform_project_settings(name) ⇒ String?
Returns the value of the setting or nil if not found.
61 62 63 |
# File 'lib/applyrics/project.rb', line 61 def platform_project_settings(name) @project.platform_project_settings(name) end |
#rebuild_files ⇒ Object
Rebuild the language files.
71 72 73 |
# File 'lib/applyrics/project.rb', line 71 def rebuild_files @project.rebuild_files() end |
#string_files ⇒ Object?
Returns the strings files found in the project.
66 67 68 |
# File 'lib/applyrics/project.rb', line 66 def string_files @project.string_files() end |