|
1 | 1 | # staruml-ruby
|
2 | 2 |
|
3 |
| -staruml-ruby is a Ruby extension for [StarUML][staruml] 2. This extension helps you |
4 |
| -to generate Ruby code from a UML class diagram. |
5 |
| - |
6 |
| -## Installation |
7 |
| - |
8 |
| -There are several ways to install this extension. You can install manually, via |
9 |
| -StarUML extension repository, or via URL. **I strongly recommend installing via |
10 |
| -StarUML extension repository**. |
11 |
| - |
12 |
| -### Manual |
13 |
| - |
14 |
| -If you prefer to install manually. Please, follow these steps below. |
15 |
| - |
16 |
| -1. Download the latest package of staruml-ruby [here][release]. |
17 |
| -2. Create a new folder `meisyal.starumlruby` in this location. Location depends on |
18 |
| - your operating system. |
19 |
| - |
20 |
| - * Linux: `~/.config/StarUML/extensions/user` |
21 |
| - * Mac OS: `~/Library/Application Support/StarUML/extensions/user` |
22 |
| - * Windows: `C:\Users\<user>\AppData\Roaming\StarUML\extensions\user` |
23 |
| - |
24 |
| -3. Extract the package in the new extension folder. |
25 |
| -4. Open or restart StarUML if you have already opened it. |
26 |
| - |
27 |
| -Internet connection is needed before installing extension via StarUML extension |
28 |
| -repository or URL. |
29 |
| - |
30 |
| -### via StarUML extension repository |
31 |
| - |
32 |
| -Open the StarUML extension manager (**Tools** -> **Extension Manager...**) and |
33 |
| -install the Ruby extension. I recommend this installation method because it is |
34 |
| -going to install the stable version of the extension. Beside that, the installed |
35 |
| -extension is from StarUML extension repository (it means the extension is officially |
36 |
| -registered). |
37 |
| - |
38 |
| -### via URL |
39 |
| - |
40 |
| -Follow these steps below. |
41 |
| - |
42 |
| -1. Open the StarUML extension manager (**Tools** -> **Extension Manager...**). |
43 |
| -2. Select **Install From URL...** button in the bottom left corner of the pop |
44 |
| - window. |
45 |
| -3. Enter the following URL `https://github.com/meisyal/staruml-ruby`. |
46 |
| -4. Open or restart StarUML if you are already opening it. |
47 |
| - |
48 |
| -At last, open the StarUML extension manager (**Tools** -> **Extension Manager...**) |
49 |
| -and then click **Installed** tab to make sure this extension is successfully |
50 |
| -installed. |
| 3 | +staruml-ruby is a Ruby extension for [StarUML][staruml] 2. This extension helps |
| 4 | +you to generate Ruby code from a UML class diagram. |
51 | 5 |
|
52 | 6 | ## Current Status
|
53 | 7 |
|
54 | 8 | This extension currently supports generating Ruby code from a UML class diagram.
|
| 9 | +Reverse engineering from Ruby code to a UML class diagram is not supported at |
| 10 | +the moment. |
55 | 11 |
|
56 |
| -### Supported UML Concepts |
57 |
| - |
58 |
| -This tool supports StarUML model below. |
59 |
| - |
60 |
| -**Classes** |
61 |
| - |
62 |
| -* tool will generate a separated `.rb` file that contains a Ruby class. |
63 |
| -* the generated file name will be `snake_case.rb` (file name refers to the name of |
64 |
| - Ruby class). |
65 |
| -* constructor is generated by default (`def initialize` method). |
66 |
| -* a to string instance method is generated by default (`def to_s` method). |
67 |
| -* code documentation will be generated at the top of class name. |
| 12 | +Please, refer to [Supported UML concepts][umlconcept] page for futher details. |
68 | 13 |
|
69 |
| -**Attributes of clasess** |
70 |
| -* methods for set and get attributes are generated by default (it doesn't use |
71 |
| - `attr_accessor :an_attribute`). |
72 |
| -* methods for set and get attributes are grouped by theirs visibility. Same |
73 |
| - condition is applied for attribute accessor. |
74 |
| -* code documentation will be generated at the top of attribute accessor |
75 |
| - declaration if it uses attribute accessor rather than set and get attributes. |
76 |
| - |
77 |
| -**Methods of classes** |
78 |
| - |
79 |
| -* tool will generate a grouped method based on its visibility (`public`, |
80 |
| - `protected`, and `private` methods). |
81 |
| -* the generated method name is same as your method name in the model. |
82 |
| -* code documentation will be generated at the top of method name. |
83 |
| - |
84 |
| -**Method Parameters** |
85 |
| - |
86 |
| -tool will generate method parameters. |
| 14 | +## Installation |
87 | 15 |
|
88 |
| -**Generalization** |
| 16 | +The simplest way to install staruml-ruby is from StarUML extension repository. |
| 17 | +This installation method is explained as follows: |
89 | 18 |
|
90 |
| -* tool will generate a separated `.rb` file that contains an inheritance class. |
91 |
| -* the generated class name will be `class DerivedClass < BaseClass`. |
92 |
| -* constructor and a to string instance method are generated by default. |
| 19 | +1. Click **Tools** -> **Extension Manager...** on the menu bar of StarUML. |
| 20 | + The Extension Manager window will appear as a pop-up window. |
| 21 | +2. Select **Registry** button. |
| 22 | +3. Type `ruby` on search box. Ruby extension will appear. |
| 23 | +4. Press **Install** button of Ruby extension. |
93 | 24 |
|
94 |
| -**Packages** |
| 25 | +Note that internet connection is needed to perfom the installation. |
95 | 26 |
|
96 |
| -* tool will convert to Ruby module (as a folder with name `packagename` |
97 |
| - folder). |
98 |
| -* the `packagename` folder contains classes that belong to the package. |
99 |
| -* code documentation will be generated at the top of package name. |
| 27 | +StarUML extension repository stores extensions that officially registered. |
| 28 | +Because of it, I **highly recommend** to use this installation method. |
| 29 | +Registered extensions are available on [this page][starumlextension]. |
100 | 30 |
|
101 |
| -**Constants** |
| 31 | +See [Installation][installation] for other installation methods. |
102 | 32 |
|
103 |
| -* tool will generate constants. |
104 |
| -* the constants support public and private constants. |
| 33 | +## Usage |
105 | 34 |
|
106 |
| -## How to use this extension |
| 35 | +When this extension is successfully installed, it's time to use the extension. |
| 36 | +Prepare your model that contains a UML class diagram and then: |
107 | 37 |
|
108 |
| -Please, follow these steps below. |
| 38 | +1. Click **Tools** -> **Ruby** -> **Generate Code...** on the menu bar of |
| 39 | + StarUML. A pop-up window will appear. |
| 40 | +2. Choose a model that will be generated its code. And then, press **OK** |
| 41 | + button. |
| 42 | +3. Select a location where the generated code will be stored. |
| 43 | +4. Press **Open** button. |
109 | 44 |
|
110 |
| -1. Click the menu (**Tools** -> **Ruby** -> **Generate Code...**). |
111 |
| -2. Select a model which will be generated its code in the pop window. And then, |
112 |
| - click **OK**. |
113 |
| -3. Select a location where the generated code will be saved. |
114 |
| -4. The generated code will be saved in the place where you selected before. |
| 45 | +Your Ruby code is generated. :yay: |
115 | 46 |
|
116 |
| -## How to configure this extension |
| 47 | +## Configuration |
117 | 48 |
|
118 |
| -You can configure the extension before generating the code. |
| 49 | +You can configure the extension before generating the code. The configuration |
| 50 | +handles how the generated code looks like. Indentation of code and code comment, |
| 51 | +for example. This is supported by this extension to generate Ruby code, as |
| 52 | +you prefer. |
119 | 53 |
|
120 |
| -1. Click the menu (**Tools** -> **Ruby** -> **Configure...**). |
121 |
| -2. Manage the configuration for code generation (there are some options there). You |
122 |
| - can always restore default configurations. |
123 |
| -3. Click **Close** when you have configured it. |
| 54 | +Check [Configuration][configuration] to configure the extension. |
124 | 55 |
|
125 | 56 | ## Documentation
|
126 | 57 |
|
127 | 58 | Documentation is available at [staruml-ruby GitHub Wiki][wiki]. Documentation
|
128 |
| -contains a lot more detail on examples, use and features, and roadmap. |
| 59 | +contains a lot more detail on examples, features, and roadmap. |
129 | 60 |
|
130 | 61 | ## Contributing
|
131 | 62 |
|
132 |
| -Before submitting an issue or a pull request, please take a moment to look over |
133 |
| -the [contributing guidelines][contributing] first. |
| 63 | +Contributions are welcome. Before submitting an issue or a pull request, please |
| 64 | +take a moment to look over the [contributing guidelines][contributing] first. |
134 | 65 |
|
135 | 66 | ## License
|
136 | 67 |
|
137 |
| -This extension is released under the terms of MIT License. See the [LICENSE][license] |
138 |
| -file for more details. |
| 68 | +This extension is released under the terms of MIT License. See the |
| 69 | +[LICENSE][license] file for more details. |
139 | 70 |
|
140 | 71 | Copyright © 2016 Andrias Meisyal.
|
141 | 72 |
|
142 | 73 | [staruml]: http://staruml.io
|
143 |
| -[release]: https://github.com/meisyal/staruml-ruby/releases |
| 74 | +[umlconcept]: |
| 75 | +https://github.com/meisyal/staruml-ruby/wiki/Supported-UML-Concepts |
| 76 | +[starumlextension]: http://staruml.io/extensions |
| 77 | +[installation]: https://github.com/meisyal/staruml-ruby/wiki/Installation |
| 78 | +[configuration]: https://github.com/meisyal/staruml-ruby/wiki/Configuration |
144 | 79 | [wiki]: https://github.com/meisyal/staruml-ruby/wiki
|
145 | 80 | [contributing]:
|
146 | 81 | https://github.com/meisyal/staruml-ruby/blob/master/CONTRIBUTING.md
|
|
0 commit comments