my_yard 0.0.3 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (135) hide show
  1. checksums.yaml +5 -5
  2. data/lib/GlobalSettings.rb +23 -0
  3. data/{src → lib}/MyYard.rb +48 -53
  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 -148
  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 -45
  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 -47
  129. data/my_yard-0.0.2.gem +0 -0
  130. data/my_yard.gemspec +0 -20
  131. data/notes +0 -9
  132. data/src/GlobalSettings.rb +0 -22
  133. data/src/glade/MyYard.glade~ +0 -611
  134. data/src/glade/YardTheme.glade~ +0 -1062
  135. /data/{src → lib}/YardThemeDefaults.rb +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 52272996b5a8c9bb2f8bef4c40aa0bf3c62ef797
4
- data.tar.gz: 1e042d40218da41631f3548f30ccac411b79f285
2
+ SHA256:
3
+ metadata.gz: 681c79fceaac1da25b27cc9cb3f90f0b75e1fb30e6dc4ff225a8d68ea35f36f4
4
+ data.tar.gz: 8d25d964b3ed93c9d9d3aacb1402d3127855340d773e8760fc40c459070cf811
5
5
  SHA512:
6
- metadata.gz: 0d4039afac65f96cb5d642ad139988300e90671f90afcefdea0957810b38f1fc4944523ed72596d1e8182169195de7cf3eab823473bc83f854df4613638f0a7e
7
- data.tar.gz: 2c0a9f2a0a440c68a65cf71329b23a057374b5eca449d5bd4e7c168b9bfa304be2dbd455a1e7d9f6a1b0ab6109ee91814b97b2942feaf0cc8f4e4da3d8b4af14
6
+ metadata.gz: bf95cc6803c69e3ad8fb3e2b9e70bc4874e240197ded6701232c225720dfc66311b1ae871b4a784df43d8912ed24d68458f618cf123d960a338475e50f1ae581
7
+ data.tar.gz: 9f0215800dd78cdcfbde76d819586b97b87272e49b3e277ed9c6104cab8a0d40ebbac10f6b567869051f3c232980a01cd8c603db8d1f068af7b8b544fd1c8210
@@ -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,14 +26,15 @@ 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
- @export_db = true if @export_db.nil?
31
+ @export_db = false if @export_db.nil?
25
32
  @export_db_path ||= ".yardoc"
26
33
  end
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, 'index.html')}")
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