my_yard 0.0.2 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. checksums.yaml +5 -5
  2. data/lib/GlobalSettings.rb +23 -0
  3. data/{src → lib}/MyYard.rb +47 -52
  4. data/{src → lib}/YardTheme.rb +12 -9
  5. data/{src → lib}/glade/MyYard.glade +151 -213
  6. data/{src → lib}/glade/YardTheme.glade +314 -407
  7. data/lib/my_yard.rb +7 -0
  8. data/my_yard +59 -34
  9. metadata +21 -147
  10. data/README.md +0 -25
  11. data/doc/GlobalSettings.html +0 -552
  12. data/doc/MyYard.html +0 -1201
  13. data/doc/TreeContext/Alternator.html +0 -297
  14. data/doc/TreeContext.html +0 -467
  15. data/doc/YardTheme.html +0 -746
  16. data/doc/YardThemeDefaults.html +0 -498
  17. data/doc/_index.html +0 -170
  18. data/doc/class_and_method_list.html +0 -322
  19. data/doc/class_list.html +0 -51
  20. data/doc/css/common.css +0 -0
  21. data/doc/css/full_list.css +0 -58
  22. data/doc/css/style.css +0 -474
  23. data/doc/file.README.html +0 -100
  24. data/doc/file_list.html +0 -56
  25. data/doc/frames.html +0 -17
  26. data/doc/img/logo.png +0 -0
  27. data/doc/index.html +0 -100
  28. data/doc/js/app.js +0 -243
  29. data/doc/js/full_list.js +0 -216
  30. data/doc/js/jquery.js +0 -4
  31. data/doc/just_file_list.html +0 -40
  32. data/doc/method_list.html +0 -843
  33. data/doc/top-level-namespace.html +0 -118
  34. data/home_my_yard/templates/visualruby/class/dot/superklass.erb +0 -3
  35. data/home_my_yard/templates/visualruby/class/html/constructor_details.erb +0 -8
  36. data/home_my_yard/templates/visualruby/class/html/subclasses.erb +0 -4
  37. data/home_my_yard/templates/visualruby/class/text/subclasses.erb +0 -5
  38. data/home_my_yard/templates/visualruby/constant/text/header.erb +0 -11
  39. data/home_my_yard/templates/visualruby/docstring/html/abstract.erb +0 -4
  40. data/home_my_yard/templates/visualruby/docstring/html/deprecated.erb +0 -1
  41. data/home_my_yard/templates/visualruby/docstring/html/index.erb +0 -5
  42. data/home_my_yard/templates/visualruby/docstring/html/note.erb +0 -6
  43. data/home_my_yard/templates/visualruby/docstring/html/private.erb +0 -4
  44. data/home_my_yard/templates/visualruby/docstring/html/returns_void.erb +0 -1
  45. data/home_my_yard/templates/visualruby/docstring/html/text.erb +0 -1
  46. data/home_my_yard/templates/visualruby/docstring/html/todo.erb +0 -6
  47. data/home_my_yard/templates/visualruby/docstring/text/abstract.erb +0 -2
  48. data/home_my_yard/templates/visualruby/docstring/text/deprecated.erb +0 -2
  49. data/home_my_yard/templates/visualruby/docstring/text/index.erb +0 -2
  50. data/home_my_yard/templates/visualruby/docstring/text/note.erb +0 -4
  51. data/home_my_yard/templates/visualruby/docstring/text/private.erb +0 -2
  52. data/home_my_yard/templates/visualruby/docstring/text/returns_void.erb +0 -1
  53. data/home_my_yard/templates/visualruby/docstring/text/text.erb +0 -1
  54. data/home_my_yard/templates/visualruby/docstring/text/todo.erb +0 -4
  55. data/home_my_yard/templates/visualruby/fulldoc/html/class_and_method.erb +0 -42
  56. data/home_my_yard/templates/visualruby/fulldoc/html/css/common.css +0 -1
  57. data/home_my_yard/templates/visualruby/fulldoc/html/css/full_list.css +0 -62
  58. data/home_my_yard/templates/visualruby/fulldoc/html/css/style.css +0 -476
  59. data/home_my_yard/templates/visualruby/fulldoc/html/frames.erb +0 -17
  60. data/home_my_yard/templates/visualruby/fulldoc/html/full_list.erb +0 -37
  61. data/home_my_yard/templates/visualruby/fulldoc/html/full_list_class.erb +0 -2
  62. data/home_my_yard/templates/visualruby/fulldoc/html/full_list_file.erb +0 -7
  63. data/home_my_yard/templates/visualruby/fulldoc/html/full_list_method.erb +0 -10
  64. data/home_my_yard/templates/visualruby/fulldoc/html/js/app.js +0 -243
  65. data/home_my_yard/templates/visualruby/fulldoc/html/js/full_list.js +0 -213
  66. data/home_my_yard/templates/visualruby/fulldoc/html/js/jquery.js +0 -4
  67. data/home_my_yard/templates/visualruby/fulldoc/html/just_files.erb +0 -33
  68. data/home_my_yard/templates/visualruby/layout/dot/header.erb +0 -6
  69. data/home_my_yard/templates/visualruby/layout/html/breadcrumb.erb +0 -11
  70. data/home_my_yard/templates/visualruby/layout/html/files.erb +0 -11
  71. data/home_my_yard/templates/visualruby/layout/html/footer.erb +0 -5
  72. data/home_my_yard/templates/visualruby/layout/html/headers.erb +0 -15
  73. data/home_my_yard/templates/visualruby/layout/html/index.erb +0 -2
  74. data/home_my_yard/templates/visualruby/layout/html/layout.erb +0 -30
  75. data/home_my_yard/templates/visualruby/layout/html/listing.erb +0 -4
  76. data/home_my_yard/templates/visualruby/layout/html/objects.erb +0 -32
  77. data/home_my_yard/templates/visualruby/layout/html/script_setup.erb +0 -4
  78. data/home_my_yard/templates/visualruby/layout/html/search.erb +0 -13
  79. data/home_my_yard/templates/visualruby/method/html/header.erb +0 -17
  80. data/home_my_yard/templates/visualruby/method/text/header.erb +0 -1
  81. data/home_my_yard/templates/visualruby/method_details/html/header.erb +0 -3
  82. data/home_my_yard/templates/visualruby/method_details/html/method_signature.erb +0 -25
  83. data/home_my_yard/templates/visualruby/method_details/html/source.erb +0 -10
  84. data/home_my_yard/templates/visualruby/method_details/text/header.erb +0 -10
  85. data/home_my_yard/templates/visualruby/method_details/text/method_signature.erb +0 -12
  86. data/home_my_yard/templates/visualruby/module/dot/child.erb +0 -1
  87. data/home_my_yard/templates/visualruby/module/dot/dependencies.erb +0 -3
  88. data/home_my_yard/templates/visualruby/module/dot/header.erb +0 -6
  89. data/home_my_yard/templates/visualruby/module/dot/info.erb +0 -14
  90. data/home_my_yard/templates/visualruby/module/html/attribute_details.erb +0 -10
  91. data/home_my_yard/templates/visualruby/module/html/attribute_summary.erb +0 -8
  92. data/home_my_yard/templates/visualruby/module/html/box_info.erb +0 -43
  93. data/home_my_yard/templates/visualruby/module/html/children.erb +0 -8
  94. data/home_my_yard/templates/visualruby/module/html/constant_summary.erb +0 -13
  95. data/home_my_yard/templates/visualruby/module/html/defines.erb +0 -3
  96. data/home_my_yard/templates/visualruby/module/html/header.erb +0 -5
  97. data/home_my_yard/templates/visualruby/module/html/inherited_attributes.erb +0 -14
  98. data/home_my_yard/templates/visualruby/module/html/inherited_constants.erb +0 -8
  99. data/home_my_yard/templates/visualruby/module/html/inherited_methods.erb +0 -19
  100. data/home_my_yard/templates/visualruby/module/html/item_summary.erb +0 -40
  101. data/home_my_yard/templates/visualruby/module/html/method_details_list.erb +0 -9
  102. data/home_my_yard/templates/visualruby/module/html/method_summary.erb +0 -14
  103. data/home_my_yard/templates/visualruby/module/html/methodmissing.erb +0 -12
  104. data/home_my_yard/templates/visualruby/module/html/pre_docstring.erb +0 -1
  105. data/home_my_yard/templates/visualruby/module/text/children.erb +0 -10
  106. data/home_my_yard/templates/visualruby/module/text/class_meths_list.erb +0 -8
  107. data/home_my_yard/templates/visualruby/module/text/extends.erb +0 -8
  108. data/home_my_yard/templates/visualruby/module/text/header.erb +0 -7
  109. data/home_my_yard/templates/visualruby/module/text/includes.erb +0 -8
  110. data/home_my_yard/templates/visualruby/module/text/instance_meths_list.erb +0 -8
  111. data/home_my_yard/templates/visualruby/onefile/html/files.erb +0 -5
  112. data/home_my_yard/templates/visualruby/onefile/html/headers.erb +0 -6
  113. data/home_my_yard/templates/visualruby/onefile/html/layout.erb +0 -17
  114. data/home_my_yard/templates/visualruby/onefile/html/readme.erb +0 -3
  115. data/home_my_yard/templates/visualruby/root/dot/child.erb +0 -3
  116. data/home_my_yard/templates/visualruby/tags/html/example.erb +0 -11
  117. data/home_my_yard/templates/visualruby/tags/html/index.erb +0 -3
  118. data/home_my_yard/templates/visualruby/tags/html/option.erb +0 -24
  119. data/home_my_yard/templates/visualruby/tags/html/overload.erb +0 -14
  120. data/home_my_yard/templates/visualruby/tags/html/see.erb +0 -8
  121. data/home_my_yard/templates/visualruby/tags/html/tag.erb +0 -20
  122. data/home_my_yard/templates/visualruby/tags/text/example.erb +0 -12
  123. data/home_my_yard/templates/visualruby/tags/text/index.erb +0 -1
  124. data/home_my_yard/templates/visualruby/tags/text/option.erb +0 -20
  125. data/home_my_yard/templates/visualruby/tags/text/overload.erb +0 -19
  126. data/home_my_yard/templates/visualruby/tags/text/see.erb +0 -11
  127. data/home_my_yard/templates/visualruby/tags/text/tag.erb +0 -13
  128. data/home_my_yard/themes/visualruby.yaml +0 -36
  129. data/my_yard.gemspec +0 -20
  130. data/notes +0 -9
  131. data/src/GlobalSettings.rb +0 -22
  132. data/src/glade/MyYard.glade~ +0 -611
  133. data/src/glade/YardTheme.glade~ +0 -1062
  134. /data/{src → lib}/YardThemeDefaults.rb +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 0896edbe3c81dc597d2b8e6e6a71b4ebd92a363e
4
- data.tar.gz: 471020ea63ad731f8531dccad84a03f1c4090925
2
+ SHA256:
3
+ metadata.gz: 5a200b8335d6175bfb8dffc8b466fc0fb705a0cf0c4d0684b4d70d401af2cd52
4
+ data.tar.gz: c1addbb4b2361e364e6e7a0cd8e267aa46f00312b9756415d3f6894430a06c0c
5
5
  SHA512:
6
- metadata.gz: cff407463a429c4bb0600d7fc99c2626dba3b18df341b0db2c29d48faba54f21c8d069dfacd3a88e1725a17dae0010b4b02e464e9506b696cf3855fc7fdde003
7
- data.tar.gz: c362ebb3ec29d00132a229f5fe340be0b614ee717d0d4b1d236cddb7a1d9b004e935ca30f48c0872c8f7bd9386d1e36ef4ba4a1559eb761bff090f36ce7a3444
6
+ metadata.gz: 5154630c16725c3973b7eca8de9e52ac3aa89428953a5d9742837e91bc4416dea24f9f762c119ea76d13e89b6390d9aa52f321d024fe81bcd0962777ea81d091
7
+ data.tar.gz: 44a235a560c423ce93f2cd368f62340514cfe40ba96f61dbdff8c16368e0ca6b7485934fd723a81000dafc6db2fc222c1cf7da433883b81bbfa6774242b16875
@@ -0,0 +1,23 @@
1
+ #
2
+ # class GlobalSettings
3
+ #
4
+ # include GladeGUI
5
+ #
6
+ # attr_accessor :browser, :projects, :theme_root, :template_root
7
+ #
8
+ # def defaults
9
+ # @browser ||= "firefox"
10
+ # @projects ||= []
11
+ # @theme_root = File.join(Dir.home, "my_yard", "themes")
12
+ # @template_root = File.join(Dir.home, "my_yard", "templates")
13
+ # end
14
+ #
15
+ # def add_project(proj_path)
16
+ # unless @projects.include?(proj_path)
17
+ # @projects << proj_path
18
+ # VR::save_yaml(self)
19
+ # end
20
+ # end
21
+ #
22
+ # end
23
+ #
@@ -3,14 +3,21 @@ class MyYard
3
3
 
4
4
  include GladeGUI
5
5
 
6
- def initialize
6
+ def initialize()
7
7
  defaults
8
8
  end
9
9
 
10
10
  def defaults
11
- @project_root = $open_project
12
- @output_dir ||= "doc"
13
- @theme = "default" if @theme.nil? or !File.exist?(File.join($env.theme_root, @theme + ".yaml"))
11
+ unless File.directory?(File.join(Dir.home, "my_yard"))
12
+ VR.copy_recursively File.join(File.dirname(__FILE__), "..", "home_my_yard"), File.join(Dir.home, "my_yard")
13
+ VR::load_yaml(YardTheme, File.join(Dir.home, "my_yard", "themes", "default.yaml")) # create default theme
14
+ end
15
+
16
+ @project_root = Dir.pwd
17
+ @theme_root = File.join(Dir.home, "my_yard", "themes")
18
+ @template_root = File.join(Dir.home, "my_yard", "templates")
19
+ @output_dir ||= "docs"
20
+ @theme = "default" if @theme.nil? or !File.exist?(File.join(@theme_root, @theme + ".yaml"))
14
21
  @template ||= "default"
15
22
  @files ||= "*/**/*.rb */**/*.c"
16
23
  @extra_files ||= "*/**/*.md"
@@ -19,7 +26,7 @@ class MyYard
19
26
  @include_private ||= false
20
27
  @include_protected ||= false
21
28
  @include_private_tag ||= false
22
- @title ||= "Generated with Yard v0.9.0"
29
+ @title ||= "Generated with my_yard "
23
30
  @main ||= "README.md"
24
31
  @export_db = true if @export_db.nil?
25
32
  @export_db_path ||= ".yardoc"
@@ -27,6 +34,7 @@ class MyYard
27
34
 
28
35
  def before_show()
29
36
  fill_combo_boxes
37
+ set_glade_variables
30
38
  end
31
39
 
32
40
  def buttonGenerate__clicked(*args)
@@ -55,7 +63,7 @@ class MyYard
55
63
  end
56
64
  if @template != "default"
57
65
  args << "--template-path"
58
- args << $env.template_root
66
+ args << @template_root
59
67
  args << "--template"
60
68
  args << @template
61
69
  end
@@ -67,7 +75,6 @@ class MyYard
67
75
  end
68
76
  if File.directory?(@project_root) and @project_root != ENV["HOME"]
69
77
  YARD::Registry.clear
70
- # YARD::Templates::ErbCache.clear!
71
78
  old_dir = Dir.pwd
72
79
  FileUtils.cd(@project_root)
73
80
  YARD::CLI::Yardoc.run(*args)
@@ -76,57 +83,65 @@ class MyYard
76
83
  alert "Invalid Project Folder.", parent: self
77
84
  end
78
85
  if @theme != "default"
79
- css = VR::load_yaml(YardTheme, File.join($env.theme_root, @theme + ".yaml"))
86
+ css = VR::load_yaml(YardTheme, File.join(@theme_root, @theme + ".yaml"))
80
87
  css.export_to(File.join(@project_root, @output_dir, "css", "common.css"))
81
88
  # $default_theme.export_to(File.join(@project_root, @output_dir, "css", "common.css"))
82
89
  else
83
90
  css = File.join(@project_root, @output_dir, "css", "common.css")
84
91
  File.delete(css) if File.exist?(css)
85
92
  end
93
+ alert("Documents created in the '#{@output_dir}' folder.", headline: "Documents Generated", width: 500)
86
94
  end
87
95
 
88
- def project_root__changed(*a)
89
- return unless @builder[:project_root].model.count == $env.projects.size
90
- return if @builder[:project_root].active_text == $open_project
91
- save_state
92
- $open_project = @builder[:project_root].active_text
93
- @builder[:window1].destroy
96
+
97
+ def theme__changed(*a)
98
+ get_glade_variables
94
99
  end
95
100
 
96
101
  def fill_combo_boxes()
97
102
  @builder[:template].append_text "default"
98
- glob = File.join($env.template_root, "*/")
103
+ glob = File.join(@template_root, "*/")
99
104
  Dir.glob(glob).each do |path|
100
105
  @builder[:template].append_text File.basename(path)
101
106
  end
102
107
  fill_themes
103
- $env.projects.each do |path|
104
- @builder[:project_root].append_text path
105
- end
106
108
  end
107
109
 
108
110
  def fill_themes()
109
111
  @builder[:theme].model.clear
110
- glob = File.join($env.theme_root, "*.yaml")
112
+ glob = File.join(@theme_root, "*.yaml")
111
113
  Dir.glob(glob).each do |path|
112
- @builder[:theme].append_text File.basename(path, ".*")
114
+ @builder[:theme].append_text File.basename(path, ".*")
113
115
  end
114
116
  end
115
117
 
118
+ def buttonCopy__clicked(*args)
119
+ copy = alert("Enter name for your new theme: ", data: "my_theme", headline: "Create New Theme")
120
+ if copy.is_a? String and copy != "" and copy != "default"
121
+ current_theme = File.join(@theme_root, @theme + ".yaml")
122
+ new_theme = File.join(@theme_root, copy + ".yaml")
123
+ FileUtils.cp current_theme, new_theme
124
+ fill_themes
125
+ @theme = copy
126
+ set_glade_variables # select new theme
127
+ save_state
128
+ end
129
+ end
130
+
116
131
  def buttonEditTheme__clicked(*a)
117
- get_glade_variables
118
- file = File.join($env.theme_root, @theme + ".yaml")
132
+ if @theme == "default"
133
+ alert("You can't edit the default theme. Make a copy of it, and edit the copy.")
134
+ return
135
+ end
136
+ file = File.join(@theme_root, @theme + ".yaml")
119
137
  win = VR::load_yaml(YardTheme, file)
120
- win.show_glade(self)
121
- fill_themes
122
- set_glade_variables # select theme again
138
+ win.show_glade(self)
123
139
  end
124
140
 
125
141
  def buttonOpenProject__clicked(*a)
126
142
  if folder = alert("Enter folder to open:",
127
- parent: self, input_text: Dir.home + "/",
128
- headline: "Open Folder", button_yes: "Open",
129
- button_no: "Cancel")
143
+ parent: self, data: Dir.home + "/",
144
+ headline: "Open Folder", button_yes: "Open")
130
145
  if File.directory?(folder)
131
146
  save_state
132
147
  $open_project = folder
@@ -135,17 +150,6 @@ class MyYard
135
150
  end
136
151
  end
137
152
 
138
- def buttonBrowse__clicked(*a)
139
- save_state
140
- begin
141
- IO.popen("#{$env.browser} #{File.join(@project_root, @output_dir, @main)}")
142
- rescue
143
- if answer = alert("Enter command to start your browser:", parent: self, input_text: $env.browser)
144
- $env.browser = answer
145
- VR::save_yaml($env)
146
- end
147
- end
148
- end
149
153
 
150
154
  def buttonDeleteProject__clicked(*a)
151
155
  if alert("This will delete this project:\n<b>#{@project_root}</b>\nDo you want to continue?",
@@ -153,10 +157,10 @@ class MyYard
153
157
  button_no: "Cancel",
154
158
  parent: self,
155
159
  headline: "Delete This Project?")
156
- $env.projects.delete(@project_root)
157
- VR::save_yaml($env)
160
+ @env.projects.delete(@project_root)
161
+ VR::save_yaml(@env)
158
162
  FileUtils.rm_rf File.join(@project_root, ".yardoc", "my_yard.yaml")
159
- $open_project = $env.projects.empty? ? :exit : $env.projects[0]
163
+ $open_project = @env.projects.empty? ? :exit : $env.projects[0]
160
164
  @builder[:window1].destroy
161
165
  end
162
166
  end
@@ -165,7 +169,7 @@ class MyYard
165
169
  get_glade_variables
166
170
  return if @theme == "default"
167
171
  if alert "Delete theme: <b>#{@theme}</b>?", parent:self, button_no: "Cancel"
168
- theme = File.join($env.theme_root, "#{@theme}.yaml")
172
+ theme = File.join(@theme_root, "#{@theme}.yaml")
169
173
  File.delete(theme)
170
174
  @theme = "default"
171
175
  fill_themes
@@ -175,20 +179,11 @@ class MyYard
175
179
 
176
180
  def window1__delete_event(*a)
177
181
  save_state
178
- $open_project = :exit
179
182
  return false
180
183
  end
181
184
 
182
- def buttonCancel__clicked(*a)
183
- save_state
184
- $open_project = :exit
185
- super
186
- end
187
-
188
-
189
185
  def save_state
190
186
  get_glade_variables
191
- @project_root = $open_project
192
187
  VR::save_yaml(self)
193
188
  end
194
189
 
@@ -45,15 +45,16 @@ class YardTheme
45
45
  end
46
46
 
47
47
  def buttonClone__clicked(*a)
48
- if clone = alert("This will make a clone of this theme. " +
49
- "Enter the name of the new theme without any extension (only letters and underscores).",
50
- headline: "Clone Theme",
51
- button_no: "Cancel",
52
- input_text: "",
53
- width: 350,
54
- parent: self)
55
- # todo lowercase, strip, replace everything except letters, numbers and underscores.
56
- path = File.join($env.theme_root, clone + ".yaml")
48
+ clone = alert("This will make a clone of this theme. " +
49
+ "Enter the name of the new theme without any extension (only letters and underscores).",
50
+ headline: "Clone Theme",
51
+ data: "",
52
+ width: 350,
53
+ parent: self)
54
+ alert clone
55
+ if clone.is_a? String and clone != "default" and clone != ""
56
+ # todo lowercase, strip, replace everything except letters, numbers and underscores.
57
+ path = File.join(Dir.home, "my_yard", "themes", clone + ".yaml")
57
58
  if File.exists?(path)
58
59
  alert "The file, <b>#{clone}</b> already exists.", parent: self
59
60
  else
@@ -61,6 +62,8 @@ class YardTheme
61
62
  VR::save_yaml(self, path)
62
63
  @builder[:headline].label = "Theme: #{clone}"
63
64
  end
65
+ else
66
+
64
67
  end
65
68
  end
66
69