Class: Uniword::WindowsWordImplementation
Instance Method Summary
collapse
#available_color_schemes, #available_font_schemes, #available_stylesets, #available_themes, detect
Instance Method Details
#cache_path ⇒ Object
56
57
58
59
|
# File 'lib/uniword/word_implementation_windows.rb', line 56
def cache_path
appdata = ENV["APPDATA"] || Dir.home || "."
File.join(appdata, ".uniword")
end
|
#color_schemes_path ⇒ Object
36
37
38
39
40
41
42
43
44
|
# File 'lib/uniword/word_implementation_windows.rb', line 36
def color_schemes_path
return nil unless installed?
appdata = ENV.fetch("APPDATA", nil)
return nil unless appdata
File.join(appdata, "Microsoft", "Templates", "Document Themes",
"Theme Colors")
end
|
#font_schemes_path ⇒ Object
46
47
48
49
50
51
52
53
54
|
# File 'lib/uniword/word_implementation_windows.rb', line 46
def font_schemes_path
return nil unless installed?
appdata = ENV.fetch("APPDATA", nil)
return nil unless appdata
File.join(appdata, "Microsoft", "Templates", "Document Themes",
"Theme Fonts")
end
|
#installed? ⇒ Boolean
5
6
7
8
|
# File 'lib/uniword/word_implementation_windows.rb', line 5
def installed?
!word_install_path.nil?
end
|
#stylesets_path ⇒ Object
27
28
29
30
31
32
33
34
|
# File 'lib/uniword/word_implementation_windows.rb', line 27
def stylesets_path
return nil unless installed?
appdata = ENV.fetch("APPDATA", nil)
return nil unless appdata
File.join(appdata, "Microsoft", "QuickStyles")
end
|
#themes_path ⇒ Object
18
19
20
21
22
23
24
25
|
# File 'lib/uniword/word_implementation_windows.rb', line 18
def themes_path
return nil unless installed?
appdata = ENV.fetch("APPDATA", nil)
return nil unless appdata
File.join(appdata, "Microsoft", "Templates", "Document Themes")
end
|
#version ⇒ Object
10
11
12
13
14
15
16
|
# File 'lib/uniword/word_implementation_windows.rb', line 10
def version
return nil unless installed?
"Unknown"
end
|